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"

Files: 
CommentFileSizeAuthor
#4 no-media-available-1500292-4.patch457 bytesjonathan_hunt
PASSED: [[SimpleTest]]: [MySQL] 0 pass(es).
[ View ]
#1 no-media-available-1500292-2.patch513 bytesjonathan_hunt
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch no-media-available-1500292-2.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

Comments

StatusFileSize
new513 bytes
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch no-media-available-1500292-2.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

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();

Status:Active» Needs review

Please review.

Status:Needs review» Needs work

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

Status:Needs work» Needs review
StatusFileSize
new457 bytes
PASSED: [[SimpleTest]]: [MySQL] 0 pass(es).
[ View ]

Doh. Improved patch attached.

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.

Status:Reviewed & tested by the community» Fixed

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.