For all of my content types, when I click "Select Media" and then click the "Library" tab on the overlay the images in the media library are not displayed (see attached screenshot). Numerous images are displayed in both the thumbnails and list views in /admin/content/media. If I reupload the desired image everything displays correctly, but the image is duplicated in the library (obviously) so this is not an ideal long term solution. This was functioning a few weeks ago, but there are no errors in /admin/reports/dblog so I can't trace it back to any changes. I'm running Drupal 7.23 with media 7.x-1.3.

I tried upgrading the media module to 7.x-2.x which required File Entity... Installing this didn't change anything and when I tried to revert back to 1.3 without File Entity my entire crashed required a complete reinstall (secondary problem to this post). Thankfully everything is back to normal, but the library tab in the media selector overlay still doesn't show any images.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ekristen’s picture

Same problem here, the Library tab in the overlay is always empty.

sylus’s picture

Perchance related to: https://drupal.org/node/1331056?

My problem was the view itself for media browser added the patch and the view + associated media browser worked.

ekristen’s picture

The issue for me is that media library is not compatible with jquery ui 1.10

jaredcampbell’s picture

ekristen... I'm running jquery 7.x-2.3+6-dev... how did you solve the incompatibility problem?

ekristen’s picture

FileSize
1.01 KB

this should fix it ...

go to sites/all/modules/media/js/plugins

run

patch < media.library.js.patch

jaredcampbell’s picture

ekristen! You Rock! If you're ever in the DC area I owe you a drink.

ekristen’s picture

haha, glad it worked.

I live just south of the beltway in Maryland :)

jaredcampbell’s picture

No kidding? Small, small world. Hit me up via the envelope in the upper left corner... www.district-trivia.com

aethr’s picture

I experienced the same problem with Media 1.3 after enabling jQuery Update with a patch for jQuery UI 1.10. I create an almost identical patch to solve the issue.

Confirming that this solved the issue for me.

Off-topic but I grew up in Potomac, MD. Small world. :)

tsbah’s picture

Thanks for the patch, ekristen.

tsbah’s picture

ekristen's patch corrects the issue of the Media tab not displaying in the Content drop-down window. But when I click on the Media tab, I get the WSOD at http://localhost/~tsbah/../admin/content/media

SolomonGifford’s picture

I can confirm this patch solved the issue for us as well. Thanks ekristen.

Smaug’s picture

Issue summary: View changes

Yep, it worked for me too. Nice one ekristen.

If it didn't look like it worked, don't forget to clear browser cache too.

andyrigby’s picture

The patch fixed it for me too, media-7.x-1.4. Thanks!

pfaocle’s picture

New Git-based patch that should work with Drush make files.

pilotget’s picture

Thank you. The patch solved most of my problem.

The only issue now is that the pager is missing. I have hundreds of images in the library, but only the first 15 are shown with no pager at the bottom. Is this a similar jQuery problem? (I'm using jQuery update to 1.7)

See attached Screen Shot 2014-05-13 at 12.53.57 AM.png

jaredcampbell’s picture

I'm having the same problem as #16. The images are now displayed resolving the initial problem, but only the last 15 images. This is resulting in my users uploading the same image multiple times since they can't page past the most recent 15.

ChristianSanders’s picture

Thanks EKristen, patch worked great. As with #15 and #16 I too can't see a pager.

sagraham’s picture

This patch fixed my issue.

For those unable to get pagination / auto-load / see the pager, the solution on this thread worked for me: https://drupal.org/node/2104493

jaredcampbell’s picture

sagraham... Thanks for that link. It worked and now I can see more than the last 12 images from the library for the first time since I submitted this bug! =D

rcodina’s picture

I can confirm #5 patch works with Media 7.x-1.4! I think this issue priority should be updated to Major and commited ASAP because if the library tab doesn't work this module is useless! I know it works on jquery 1.5 but If people like me are forced to upgrade jquery on admin pages then they can't use this module!

I have found out that with this patch:
jquery 1.5 => KO (media popup opens but it's not usable)
jquery 1.7 => OK
jquery 1.8 => OK
jquery 1.9 => OK
jquery 1.10 => OK

Without it:
jquery 1.5 => OK
jquery 1.7 => KO (library tab empty)
jquery 1.8 => KO (library tab empty)
jquery 1.9 => KO (library tab empty)
jquery 1.10 => KO (library tab empty)

Finally, thank you sagraham for your link. The patch there also works for me!

dkmn’s picture

Yeah, I agree. Why is this not folded into the development line?

rogerpfaff’s picture

I'm using Bootstrap 3 / Jquery-Update 2.4 / ckeditor 4 and the patch is not working for me. Choosing Seven as content editing interface makes it functional.

xaa’s picture

hi, I'm also using Bootstrap3 with the latest jquery version (+Rubik as Administration theme).

"The issue for me is that media library is not compatible with jquery ui 1.10"

Indeed. So if you don't want to patch the module (awaiting the official release ;)) and if your backend doesn't need to use the latest Jquery version a workaround is simply to adjust the jquery version used for the backend

(see /admin/config/development/jquery_update : "Alternate jQuery version for administrative pages" > select 1.5 will fix the issue).

chaloum’s picture

the #5 patch displays the images but I cant submit when picking an image from the library

baltazarz3’s picture

Im working on superhero's drupal theme and i wasnt able to change jquery versions or ui. ekristen's patch worked for me. thanks so much!

dooug’s picture

Version: 7.x-1.3 » 7.x-1.4
Status: Active » Reviewed & tested by the community
FileSize
1.06 KB

I was able to replicate the original issue. The patch from #15 did the trick. However, I modified the patch to not include the additional newline at the end of the file.

Marking as RTBC because of numerous reviews. The cases which the patch didn't solve the problem seemed to be because of other jQuery versions or admin themes issues as in #23.

madeby’s picture

My images are loading but when I scroll to the bottom it doesn't load more images and I have no pagination.

Any ideas?

dooug’s picture

@madeby, did you try the solution in #19 that references this issue: #2104493: Media Browser only shows 1 page of results (Media v1)

cmunk’s picture

#24 worked for me!

madeby’s picture

#29 @dooug it worked! Thanks.

mtrax’s picture

@dooug applied patch but still see no images in the library and can see media when I view Content page but not when creating article and clicking add media

..update setting JQuery Update to version 1.5 fixes the problem

agileadam’s picture

#27 worked perfectly for me. Thanks!

blasthaus’s picture

The only problem I had with this was that when scrolling down in the media browser, at least on Safari the page itself would scroll out of view. The fix was to add a class of 'fixed' to the body when a popover occurs. Since it's really only an issue due to this idea of scrolling down in a modal which is broken

I did the following:

file: media.popups.js
in Drupal.media.popups.mediaBrowser
after the call to mediaIframe.bind() add
$('body').addClass('fixed');

Then everywhere that the popup is dismissed (ok, cancel, finalizeSelection) add
$('body').removeClass('fixed');

Finally the css rule (and I'm not sure where this goes). I put it in my admin theme and default theme.

/* media browser fixed body */
body.fixed {
  overflow: hidden;
}

Would be cool to also include this in the above patch, so this issue is solved.

Tomefa’s picture

Thanks for the patch, it works fine now !
I think it's a good idea to make a new release of the media module, because that's a really annoying bug on almost all the recent website.

Same comment goes for the patch here : https://www.drupal.org/node/2104493

steinmb’s picture

Title: No images are displayed in the media selectory overlay library tab » JQuery update break media browser. N0 media elements are displayed in the media library tab
Version: 7.x-1.4 » 7.x-1.x-dev
Status: Reviewed & tested by the community » Needs work

Enviroment

Latest stable Drupal relase
query_update (7.x-2.4)
Media 7.x-1.x
Browsers: Chrome Version 38.0.2125.101 - Firefox 32.0.3
Platform: OS X
PHP 5.5.x
MariaDB 10.x
Patch #27

How to reproduce

Clean installation of Drupal and Media 7.x-1.x. Running with core jquery and the module work OK, both latest stable and latest dev. Installing jquery update make the query/req. fail. Jquery version 1.7 or higher. Applying the patch does nothing on my system to fix this.

Easiest way to verify this is loading the following page (replace flickr.dev with your test site).
http://flickr.dev/media/browser?render=media-popup&types[audio]=audio&types[image]=image&types[video]=video&types[default]=default&activePlugins=&schemes[youtube]=youtube&schemes[public]=public&file_directory=&file_extensions=png+jpg+gif+jpeg&max_filesize=&uri_scheme=public&plugins=undefined

Clicking the library tab trigger no POST req. so it remain empty.

rcodina’s picture

@steinmb Have you tested all patches enclosed in this issue? It works great for a lot of people.

steinmb’s picture

Ref. my tests in #36. I tested patch #27. It is unusual to test them all :) Only one will get committed to dev. if it actually fix the issue. To make sure I did not bork my testing environment, I'll will run my tests again.

Tomefa’s picture

Try right now with simpletest.me : http://s1260f45135f61f4.s3.simplytest.me
Add module media (with dependencies) + add module jquery_update (enable it).

Change the field image of the article content type to widget type : media file selector.
And then the library tabs doesn't work anymore.

ZalemCitizen’s picture

Thanks for this patch!

srobert72’s picture

Patch #27 works for me.

My configuration :
Media : 7.x-1.4
Media_Youtube : 7.x-2.0-rc4
JQueryUpdate : 1.10
JQueryUpdate for Admin : 1.8

steinmb’s picture

@srobert72 Any chance for you to try without the patch but with dev versions: Media : 7.x-1.dev
Media_Youtube : 7.x-2.0-dev ? Was unable to see the patch fix the problem back in #36.

Status: Needs work » Needs review

The last submitted patch, 5: media.library.js_.patch, failed testing.

corbacho’s picture

@steinmb I had the same problem: empty Library http://monosnap.com/image/LCT2hR5rYXMHNJfDJQ5bChHk7GsDV0
with jQuery Update:
jQuery 1.7
Media 1.4

I tested with media dev 1.x but didn't fix anything. I reverted back to Media 1.4, apply #27 patch and it solved the problem!

Anonymous’s picture

Status: Needs review » Reviewed & tested by the community

This works. Marking this as RTBC.

johan.falk.oddhill’s picture

It works for me when i switch the "jQuery and jQuery UI CDN" to jQuery under jQuery update configurations.

  • aaron committed 8851cb1 on 7.x-1.x
    Issue #2089697 by dooug, pfaocle, ekristen: fixed JQuery update break...
aaron’s picture

Status: Reviewed & tested by the community » Fixed
Dave Reid’s picture

Did anyone confirm this patch works *without* jquery_update and just native Drupal core + Media? All I see are confirmations that it works with jquery_update being used.

steinmb’s picture

@dave reid, I do not think so. Also look at #36 I was unable to get this patch to fix anything...

J McDermott’s picture

8851cb1 does not appear to work without jquery_update. Media 7.x-1.4+2-dev without jquery_update, however, worked well on the same installation.

Dave Reid’s picture

Yes, confirmed on simplytest.me this is a regression. We cannot simply code our JS for the versions of jquery_update, we need to consider something that works for both newer and the default version that ships with core, always.

  • Dave Reid committed e30edd7 on 7.x-1.x
    Revert "Issue #2089697 by dooug, pfaocle, ekristen: fixed JQuery update...
Dave Reid’s picture

Status: Fixed » Needs work

Reverted the commit and setting back to needs work. Please make sure patches are tested under both default and newer versions of jQuery prior to commit.

sp_mw queued 5: media.library.js_.patch for re-testing.

The last submitted patch, 5: media.library.js_.patch, failed testing.

kikko’s picture

Thanks guys: with a superhero ME theme switch administration jquery to 1.5 it work (media 7.x-1.4)

michenus’s picture

Thank guys. #27 helped: Version jquery 1.10.

michenus’s picture

Thank guys. #27 helped: Version jquery 1.10.

sebcolor queued 5: media.library.js_.patch for re-testing.

The last submitted patch, 5: media.library.js_.patch, failed testing.

rsacher1’s picture

Sorry for my ignorance as a Drupal-newbie:

...how do I apply the patch?
...can I download an already patched version?

MichaelGreisman’s picture

#27 fixed this issue for my site, which uses jQuery 1.7.

@rsacher1, try these directions:

but failing all else, read the patch file:

  1. the filename is at the top; ignore the leading "a" or "b" in " a/js/plugins/media.library.js b/js/plugins/media.library.js" and find the file in sites/all/modules/media/js/plugins/;
  2. remove any existing lines prefixed with a minus;
  3. replace them or add any existing lines prefixed with a plus.

That is now enough info to get you into trouble. Oh yeah, back it up first!

aaronott’s picture

#27 just worked for me as well. We are using jQuery 1.8 and the library is now displaying the images as expected.

Thanks @pfaocle and @dooug!!

jennypanighetti’s picture

#27 worked for me as well, with Media 1.5 and jQuery 1.8. THANK YOU!

mr.marlin’s picture

I had the same issue where no images appeared within the Library tab.

My configuration: Drupal 7.34, Bootstrap 3, Media 7.x-1.5 and jQuery Update 7.x-2.5

To make work, I needed to make the following Configuration settings:
- jQuery Update "Alternate jQuery version for administrative pages" set to 1.5
- Media Browser settings - set Media browser theme to "Seven"
- Flush all the caches

Now it works. Thank you to #23 Rodgerpfaff for mentioning the Media browser theme to "Seven". That was the key to making my configuration work.

Joachim Namyslo’s picture

FileSize
15.56 KB

Can confirm that evrithing works fine with

Bootstrap 3
Current Drupal 7 Release
The Seven Theme for Media in the Media Browser Settings Dialog
The Settings Below
Settings for Bootstrap 3

rcodina’s picture

Could anyone make a patch which works with both default drupal jquery version and more recent versions which can be enabled via jQuery update module?

This issue is two years old, it is time to fix this. Most people on D7 needs to use jquery with versions greater than 1.5 for contributed modules/themes to work properly.

franz.skaaning’s picture

#68 makes no sense since Bootstrap3 requires more than jquery 1.5. You get some strange results with edit/add nodes for users with no admin theme.

This works fine with jquery 1.5, but not with anything other.

Joachim Namyslo’s picture

Assigned: Unassigned » Joachim Namyslo
Status: Needs work » Needs review
FileSize
1.1 KB

This is just a try. The test protocoll said the first line was missing so I added it. We'll see if that works

Status: Needs review » Needs work

The last submitted patch, 71: media.library.js_.patch, failed testing.

rcodina’s picture

@dinmikkith Thanks for your efforts Your patch looks very similar to #27 which was rejected because it doesn't work with drupal's default jquery version. Are you sure your patch works with drupal's default version too?

Maybe we can introduce an "if" depending on jquery version. Then use "bind" or "on" depending on that value.

Joachim Namyslo’s picture

As I said I just changed the first line, because the previous test protocol told us it fails because the line was missing. I am not even sure if the patch will get merged now because I don'tt have the permission to start simple tests here.

You're right. I have nat changed a bit of the rest of the code

SandraVdv’s picture

No patch needed with jQuery Update 7.x-2.5 and Media 7.x-1.4+7-dev. The JQuery Update jquery version for administrative pages is set to "Default (provided by Drupal)".
The only thing that keeps me from updating to Media 7.x-1.5 is that the media/browser/list page callback has disappeared from media.browser.inc??
There is only a media_browser_library() available...

Joachim Namyslo’s picture

Assigned: Joachim Namyslo » Unassigned

Just to clarify. Media does always use the admin interface version because it's displayed with the admin theme, right? So what exactly is the problem with taking #27 and make j query update a dependency of media. Or in other words why does the core still need v1.5 while we are at 1.10. Can someone point that out, please?

rcodina’s picture

@dinmikkith Because using 1.10 on admin pages may break many other modules. I think the solution is simple: to just add the "if" I suggested on #73.

fizk’s picture

Status: Needs work » Needs review
FileSize
905 bytes

This works for me, with and without jquery_update enabled.

Status: Needs review » Needs work

The last submitted patch, 78: 2089697-jquery-update-media-browser-1.patch, failed testing.

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 78: 2089697-jquery-update-media-browser-1.patch, failed testing.

fizk’s picture

Status: Needs work » Needs review
FileSize
891 bytes

My previous patch was missing "index baa49e4..6c2684f 100644", that might be way the test is failing.

BR0kEN’s picture

The patch #82 works, but I didn't make a review because it contains code duplication and can be improved. I improved it and now an events occurs on different versions of jQuery.

sirko_el’s picture

I've used #83 on my project. It works fine for me and code looks nice and clean.

gaydamaka’s picture

#83 works fine for me.

m1r1k’s picture

+++ b/js/plugins/media.library.js
@@ -4,16 +4,16 @@ namespace('Drupal.media.browser');
+    var params = settings.media.browser.library,

If ajax request will contain new drupal.settings from Drupal backend, only these new settings will be passed to settings variable, so check it, otherwise you will got js unexpected error.

BR0kEN’s picture

Yep, agree with you.

m1r1k’s picture

Status: Needs review » Reviewed & tested by the community

Looks fine :)

Joachim Namyslo’s picture

A bug and 89 comments later. It would be great to see this merged in to the next stable asap.

jerrac’s picture

I just ran into this issue on a site I'm building, and the patch from #87 fixed it.

So, yes, merging it into stable would be nice. :)

Also, thanks to all the people over past 2 years who figured this out so I don't have to. :D

fenstrat’s picture

+1 for RTBC.

Can also verify this works with jquery_update (through to 1.10), or without jquery_update.

Albert Volkman’s picture

Another +1 for RTBC.

smptebars1’s picture

Can this patch be applied if I am running query-update 7.x-2.6?
Thanks

fenstrat’s picture

@smptebars1 Yes. The patch works with or without jquery_update (personally I've tested up to jquery 1.10 with 7.x-2.6).

smptebars1’s picture

@fenstrat, Thanks

Dave Reid’s picture

  • Dave Reid committed 7008670 on 7.x-1.x authored by BR0kEN
    Issue #2089697 by BR0kEN, fizk, dinmikkith, ekristen, dooug, pfaocle:...
Dave Reid’s picture

Status: Reviewed & tested by the community » Fixed

Committed #87 to 7.x-1.x. Thanks everyone!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.