With #2187837: Bring media element and field widget inline with managed_file equivalents the UX / Workflow how to add a file to a file field through the media browser has changed.
Before it worked like that:
1. Click add another item
2. Press Select for opening the media browser
3. Select a file / image
4. Press Submit
Repeat 1 -4 for adding another image
5. Save the content
Now like that:
1. Click Browse for opening the media browser
2. Select image / file
3. Submit
4. Press Attach
Repeat 1 - 4 for adding another image / file
6. Save the content
So the amount of steps is basically the same. But the user is not getting the concept in my case. It is not clear and regularly forgotten to press "Attach" If you just save the content nothing is attached and the new image you wanted to add is lost.
Is it possible to attach the file at once after pressing the "Submit" button in the media browser? (So we would have on step less, which is always good). And / or can the attach be triggered on saving the content? So if someone forgets to "Attach" the images / file is saved anyway.
Comment | File | Size | Author |
---|---|---|---|
#2 | automatically-attach-files-2216329-2.patch | 1.37 KB | Devin Carlson |
file_field_browser_workflow_NEW.jpg | 583.56 KB | marcusx | |
file_field_browser_workflow_OLD.jpg | 757.29 KB | marcusx |
Comments
Comment #1
Dave ReidI'm confused why there's the additional step as well. If the intent was to make it work more like the core File or Image fields, I don't understand. They don't have the concept of two submissions.
Comment #2
Devin Carlson CreditAttribution: Devin Carlson commentedThis functions the same as file.module's managed_file form element: you choose a file (local machine/media browser) and then upload/attach the file. This allows users to select a different file before uploading/attaching it in case they chose the wrong one by mistake.
On the code side "attaching" the file allows all of the validation, access, previews, etc to happen on the backend instead of through JS which makes development a lot easier, makes testing possible and allows the field widget to be used with JS disabled.
As with the managed_file form element, the file will still be attached if the user presses the submit button without first attaching the file. I'd suggest filing a bug report with steps to duplicate the issue as there is currently a test for this in media.test:
That said, I initially included the JS required to automatically attach the file once it has been selected in the media browser but I removed it in order to be consistent with the managed_file element. The attached patch restores the automatic attach if that's the consensus. :)
It would also be simple enough to make this configurable per field instance if that was desired.
Comment #3
marcusx CreditAttribution: marcusx commentedSeems that there are very good reasons for the change. (Non js functionality, testable, etc.) If files should not be 'auto attached' by default adding at least a configuration option sounds sensible.
But at the moment the widget is also not useable because of #2215905: Media browser widget for file field adds a operations column for every row and I am also using Media Multi-select https://drupal.org/sandbox/fangel/1652676 which is broken due this change as well. Opened already #2216273: Latest media changes break the multiselect. So UX is the most minor issue for me at the moment. Although it got the most attention.
For now I use a cherry picked version of media without these changes but with the patches I needed for proper ckeditor integration. I try to look into the other issues first and can help with this one later if there is a conclusion that we want to have it configurable.
Comment #4
vegardjo CreditAttribution: vegardjo commentedI'm also missing the possibility to edit a file entity on a node form. I made a new issue, but I belive it is related to this as it happened after upgrading: #2217061: Edit options on imagefield missing
Comment #5
jmuzz CreditAttribution: jmuzz commentedIf I understand correctly, the requirement for the user to be able to choose a different file is to cover the case when they click on the wrong thing in their browser's file chooser. If that's the case, they can already choose a different file before they upload, they just need to do it in the media browser popup instead of on the node edit page. I am in favor of the auto attaching. It seems unnecessary for the user to have to confirm their file in both the media browser and the node edit form.
Comment #6
ParisLiakos CreditAttribution: ParisLiakos commentedComment #7
hefox CreditAttribution: hefox commentedPatch is being used on a project with multiple testers/developers and has not presented any problems yet and has provided the desired functionality
Comment #8
Yuri CreditAttribution: Yuri commentedConfirming that patch #2 is working.
Comment #9
seworthi CreditAttribution: seworthi commentedConfirming patch works as advertised. RTBC
Comment #10
seworthi CreditAttribution: seworthi commentedComment #12
aaron CreditAttribution: aaron commentedCommitted to http://drupalcode.org/project/media.git/commit/fe09f09.