We have added a filter to the Media Browser view (to select Spaces in Open Atrium). This means that for some users, their initial view is empty and they need to select a different value from the filter drop-down to see files from other spaces.
Because the initial View is empty, the media-view.js file never gets added to the page. Thus, when they change the filter to see files and then try to click on a file, the browser redirects to load the file instead of just selecting the image.
The core problem is that the template_preprocess_media_views_view_media_browser() function is not executed if the view is empty. So this is not the proper place to load the javascript.
Patch coming!
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | media_browser_view_javascript_not_loaded-2528428-4.patch | 595 bytes | mpotter |
| #1 | media_browser_view_javascript_not_loaded-2528428-1.patch | 956 bytes | mpotter |
Comments
Comment #1
mpotter commentedHere is the patch. Javascript gets loaded in the hook_pre_view instead of the preprocess.
Comment #2
mpotter commentedComment #3
dave reidI'm curious if this is a big higher up that template_preprocess_media_views_view_media_browser does not get invoked for an empty browser?
Comment #4
mpotter commentedRerolled this for latest dev. It calls drupal_add_js twice, but that doesn't cause the js to get added to the page twice and makes this patch easy to apply to future versions.
Comment #5
chris matthews commentedRecent versions of media have resolved most of peoples concerns and is compatible with entity translation, multilingual and various advanced configurations. Due to the high volume of inactive and most often irrelevant issues we are Closing this as (outdated). If for whatever reason this issue is important to you AND you still have issues after checking the media recipe documentation, then let us know and we will review your concerns.
Otherwise, see the recipe documentation for how to configure media and for troubleshooting tips OR refer to the media_dev distribution if you want to see a working media setup.
As mentioned, feel free to make some noise in this issue if you still feel it is important to you or someone else.
Thanks,
Media team