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.
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"
Comment | File | Size | Author |
---|---|---|---|
#4 | no-media-available-1500292-4.patch | 457 bytes | jonathan_hunt |
#1 | no-media-available-1500292-2.patch | 513 bytes | jonathan_hunt |
Comments
Comment #1
jonathan_hunt CreditAttribution: jonathan_hunt commentedLooks like media_admin_thumbnails () in includes/media.admin.inc sets $files array then immediately resets the variable:
$files = file_load_multiple($fids);
$files = array();
Comment #2
jonathan_hunt CreditAttribution: jonathan_hunt commentedPlease review.
Comment #4
jonathan_hunt CreditAttribution: jonathan_hunt commentedDoh. Improved patch attached.
Comment #5
Devin Carlson CreditAttribution: Devin Carlson commentedThis 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 thefunction media_admin_list
function to thefunction 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.
Comment #6
Dave ReidCommitted #4 to Git: http://drupalcode.org/project/media.git/commit/24ea716
Comment #7
havensp CreditAttribution: havensp commentedI 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...