The result of having empty extensions or mimetypes expressions is not correct. The input processing does not allow the use case of only matching the listed extensions with no mimetype expression since media_admin_type_manage_form_submit() explodes these fields with a space. The end result for matching an empty field is array(0 => '').

Comments

recrit’s picture

Status: Active » Needs review
StatusFileSize
new1.1 KB

the attached patch addresses the input parsing issue.

recrit’s picture

StatusFileSize
new1.21 KB

updating patch - making both inputs split on spaces only and adding array_filter() to remove empty inputs

recrit’s picture

StatusFileSize
new1.22 KB

- re-rolling as relative so that it can be applied with drush make. (@see http://drupal.org/node/1054616#comment-4152234)
- adding trimming operation to input parsing

eclipsegc’s picture

sub

JacobSingh’s picture

StatusFileSize
new1.99 KB

This looks good, but I re-wrote it a bit in a format which doesn't use a regex or loops. I also added some docs. In general, this type definition screen is screwy. I'd like to do more to it, but this will help.

Does this also work for you?

recrit’s picture

Status: Needs review » Reviewed & tested by the community

works for me. This looks good for a quick/hot fix for now, but I agree for having a better form for these settings.
Possibly a multi-select list of the allowed file extensions.

JacobSingh’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.