I am using hook_media_browser_plugin_info_alter() to change the weight of certain plugins to ultimately have the media library be the default tab:
<?php
function hook_media_browser_plugin_info_alter(&$info) {
$info['upload']['weight'] = 12;
$info['media_internet']['weight'] = 11;
}
?>

This was working fine until I updated yesterday to the dev versions of both media and file entity (from http://drupalcode.org/project/file_entity.git/commit/945bf90b283ef56a48b...
and http://drupalcode.org/project/media.git/commit/c49692be4b1e9990bf7b01a8d... versions )
Now, the upload tab is still the default, but after uploading a new file and clicking the "Next" button, the media library tab is again the active tab. I can click back to the Upload tab and am presented with the alt/title fields for my image and I can save and submit the image into my WYSIWYG area from that point, but this process will be confusing for users.
Ultimately, I am wondering if this is a bug or as designed. If this is expected behavior, what is the proper way to change the weight/order of media browser plugin tabs if not using hook_media_browser_plugin_info_alter()?
Could this be related to #1881152: Browser display cleanup?
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 1934226-d7-2.patch | 4.46 KB | redndahead |
| medialibrarytabs.png | 85.97 KB | bneil |
Comments
Comment #1
redndahead commentedMy idea to fix this is to hide the tabs when you move onto step > 1. I'm working on a patch now to do this. What would be helpful is if someone knows how to tell what step you are currently on within the media_browser function.
Comment #2
redndahead commentedIt came to me in a dream, or nightmare, but anywho I have something working. Style is ugly, but works. I'm going to change the title, tell me if this is taking over your issue too much.
Comment #3
bneil commented@redndahead the patch in #2 fixes the problem I identified in the original post. I'm not going to set this to RTBC though since it would be nice if someone closer to the browser code could take a peek.
Thanks redndahead!
Comment #4
chris matthews commentedThe 6 year old patch in #2 does not apply to the latest media 7.x-2.x-dev and if still relevant needs to be rerolled
Comment #5
joseph.olstadfeel free to submit a rerolled patch and I will consider re-openning if you need this and want it reviewed