Closed (fixed)
Project:
D7 Media
Version:
7.x-1.0
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
26 Mar 2012 at 00:56 UTC
Updated:
12 Apr 2012 at 15:30 UTC
Jump to comment: Most recent file
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 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 commentedPlease review.
Comment #4
jonathan_hunt commentedDoh. Improved patch attached.
Comment #5
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$optionsarray and the$filesarray is never used.For some reason, the declaration of the
$filesarray was moved from thefunction media_admin_listfunction to thefunction media_admin_thumbnailsfunction 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 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...