I just updated from 7.x-1.0-rc3 to 7.x-1.0 and now admin/content/media/list lists media files (approx. 7,700) and the thumbnail display shows "No media available"

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jonathan_hunt’s picture

Looks like media_admin_thumbnails () in includes/media.admin.inc sets $files array then immediately resets the variable:

$files = file_load_multiple($fids);
$files = array();

jonathan_hunt’s picture

Status: Active » Needs review

Please review.

Status: Needs review » Needs work

The last submitted patch, no-media-available-1500292-2.patch, failed testing.

jonathan_hunt’s picture

Status: Needs work » Needs review
FileSize
457 bytes

Doh. Improved patch attached.

Devin Carlson’s picture

Status: Needs review » Reviewed & tested by the community

This was changed in http://drupalcode.org/project/media.git/commit/910aa75a7d9b4cc54f791df16...

It looks like files = array(); was originally going to be used to declare an array which would then be filled with files during the following foreach loop, however the files are added to the $options array and the $files array is never used.

For some reason, the declaration of the $files array was moved from the function media_admin_list function to the function media_admin_thumbnails function where it, as stated in #1, resets the array of files which are explicitly loaded one line above.

I don't see any problems with removing the line.

Dave Reid’s picture

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

I just encountered this issue after upgrading to 7.x-1.0 where all of a sudden all thumbnails in the library thumbnail view disappeared (I have hundreds of images in the media library) and the message "No media available" was displayed. The list/tabular view properly displayed the media items. I removed line 182 $files = array(); in media.admin.inc as mentioned above and the thumbnails now appear properly. Actually I commented out the line and didn't delete it. Thank you for the prompt fix...

Status: Fixed » Closed (fixed)

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