Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The current design of the + Add Media button leverages the media browser, which has some unintended side-effects:
- Shows all tabs, including the Views Library, which makes no sense.
- Renders it impossible (AFAIK) to render a workflow of Upload => Edit => Return, because the modal window can't be closed independently.
- Opens a modal inside an Overlay (if enabled), which seems pointless.
Patch coming which moves the add media items to a proper menu callback, allowing for better workflows. See also #1396490: Update the multiedit functionality, which is closely related.
Comment | File | Size | Author |
---|---|---|---|
#12 | 1398896-media-upload-callback.patch | 8.63 KB | agentrickard |
#9 | 1398896-media-upload-callback.patch | 7.08 KB | agentrickard |
#7 | 1398896-media-upload-callback.patch | 7.08 KB | agentrickard |
#3 | 1398896-media-upload-callback.patch | 5.89 KB | agentrickard |
#1 | 1398896-media-upload-callback.patch | 6.92 KB | agentrickard |
Comments
Comment #1
agentrickardThe patch is blocked by changes in #1396490: Update the multiedit functionality, which are tangled up in this one.
Comment #2
Dave ReidRelated: #1238298: Follow up to Media admin 'Add file' button does not work without JavaScript
Comment #3
agentrickardThis patch needs a refactor based on #1396490: Update the multiedit functionality, in particular, the redirect statements currently assume that the multi-edit form menu item is active.
The current patch is up-to-date however.
Comment #4
Dave ReidOh hrm, let me look over this again to see how it interacts. I can make changes to multiedit stuff if necessary.
Comment #5
agentrickardNo need to revert the other changes. The issue is that I'm using the edit-multiple page callback in all cases, which may not be appropriate.
Comment #6
John Pitcairn CreditAttribution: John Pitcairn commentedPossibly also related: #1241976: Mention the File Entity Revisions module in the projects page as a companion module. ?
Comment #7
agentrickardI don't think that issue is related at all.
Anyway, here's a new patch which resolves the following issues:
Comment #9
agentrickardMissed a ).
Comment #10
Dave ReidSo it seems that this breaks the media modal window. The redirects are changed from media/browser?fid=[selected-file:fid] to a normal page which breaks the magic that tells the modal window to close and select the file for the field.
Comment #11
agentrickardConfirmed. Can probably work around this contextually.
Comment #12
agentrickardHere's a patch that does that.
Comment #13
Dave ReidComment #14
Dave ReidCommitted #12 with modifications to modifying $form_state['redirect'], and having the file add paths live under file/add. I think having the change to an actual file/add is a great change and if someone wants to add the Media browser behavior back, then they should easily be able to do so.
http://drupalcode.org/project/media.git/commit/f69429b