We've been experimenting with the 2.x dev on top of the media alpha 3.

I've noticed a couple of strange behaviours:

  • replacing a single image using the edit media tab causes all images to be replaced with that image.
  • replacement of files seems to be limited to the type of file currently in place--is that intentional?

Comments

iknowbryan’s picture

I just had this same issue... not sure what the deal could be.
One note - seems like it only happens for the images AFTER the image that gets replaced.

Seems like a pretty major issue.

-=b=-

saltednut’s picture

Project: Media Gallery » File Entity (fieldable files)

This is a problem with bulk editing - not limited to Media Gallery. One can recreate this bug just by selecting multiple files from the File entity listings and choosing "Edit".

Moving this issue to File Entity.

Dave Reid’s picture

replacement of files seems to be limited to the type of file currently in place--is that intentional?

This is by design, otherwise the file could have a conflict in what fields it has filled out. Once a file type has been set for a managed file, it is not easy to change it.

I'm guessing we should just probably hide the 'replace this file' when used in the multiple-edit context?

saltednut’s picture

I'm guessing we should just probably hide the 'replace this file' when used in the multiple-edit context?

I concur.

Mirabuck’s picture

That's the route we took as a short term solution. Makes good sense to me.

saltednut’s picture

Regarding #5 - if you want to provide a patch, I'll gladly review it, Mirabuck.

Mirabuck’s picture

Thanks. I used a hook form alter in another module to hide them. Will take a look at the module code though and see if I can put a patch together.

Mirabuck’s picture

OK, I think I have a better sense of the file entity code.

Ideally, when file_entity_edit() get's called we'd know whether of not if it was part of a multi-file form. Pretty sure we don't have this info currently and I can't think of an easy way to get it beyond adding a 4th optional multi-file boolean parameter to the the function and then ensuring that it gets called in multi-file contexts.

Alternatively, we can add some form alter logic whenever multi-file forms are built to strip out $form['replace_upload']. Seems like either approach (boolean or form alter logic) would necessitate making changes to multiform - multiform_get_form() and media_bulk_upload - media_bulk_upload_file_page_edit_multiple and would require similar changes to other contrib modules such as media_gallery.

Does this sound like an accurate appraisal or am I missing something?