When I edit my field settings for my media field type and change the allowed file extensions from the defaults, the values get saved to the database, but upon editing the form again, i don't see my changes. I think the #default_value property is getting set incorrectly? Attached a patch, but definitely needs a look from someone who knows what's supposed to be going on here.

Had to tweak the patch file slightly, so please take a look at the content if it fails to apply.

Comments

jonathanmd’s picture

I hadn't tried to change out the allowed file extensions until you posted this. Interestingly enough I'm seeing the same issue on new and existing files that are of type Media Field, but I'm not seeing this when editing an image field.

aaron.r.carlton’s picture

Added new patch which fixes an error introduced when adding the field for the first time.

dave reid’s picture

Assigned: Unassigned » dave reid
StatusFileSize
new2.11 KB

Actually the real problem here is that file_extensions is actually a field instance setting, and not a widget setting. Therefore this field should be output in a new media_field_instance_settings_form() rather than in media_field_widget_settings_form().

Status: Needs review » Needs work

The last submitted patch, 1359588-media-field-instance-settings.patch, failed testing.

dave reid’s picture

Version: 7.x-2.x-dev » 7.x-1.x-dev
Status: Needs work » Needs review

Patch needs to be tested against 7.x-1.x. Will provide patch for 7.x-2.x shortly.

dave reid’s picture

dave reid’s picture

Status: Needs review » Fixed

Confirmed this fixes the issue for both existing and new media field configurations - file extensions save properly. Committed to both 7.x-2.x and 7.x-1.x.
http://drupalcode.org/project/media.git/commit/c7af8ef
http://drupalcode.org/project/media.git/commit/065282e

Status: Fixed » Closed (fixed)

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

brunodbo’s picture

Status: Closed (fixed) » Active

I'm still seeing this in 7.x-1.0-rc3 when adding a media field ('Multimedia asset') to a content type. Things work fine when using a File field with a 'Media file selector' widget. Is the latter the preferred way of doing things?

dave reid’s picture

Status: Active » Closed (fixed)

I'm not able to duplicate that this still persists in the latest code for either 7.x-1.x or 7.x-2.x. I added a Multimedia asset field to a content type, and on the Edit step changed the allowed extensions and saved the field. I checked back and the allowed extensions field still had the desired value.

rfulcher’s picture

I am having a similar issue on a 7.12 site that I just setup. I have an image field and can't add any extensions to it. I am trying to add tif to the allowable extensions and it save to the database but upon editing the content it does not display or allow the tif image to be uploaded.

Thanks