in Admin menu when accessing the Media link under Content and switching to thumbnail view the following error message is shown:
Notice: Undefined index: #file in theme_media_thumbnail() (line 288 of .../sites/all/modules/media/includes/

This is due to the administrator not performing the following task:

In Drupal 7 - You need to rebuild the media file types:: Admin Menu::Configuration / Media /Rebuild Type information for Media.

Can the error message be caught and a friendlier hint to perform the task be given to the Administrator?


lalweil’s picture

Priority:Minor» Major

Myself, and some others (as seen have this problem when trying to upload PDF files, and using the "rebuild media types" link does NOT address the problem. Anyone having similar problems? I'm using the April 9 dev version of 7.1x and it hasn't been resolved.

Notice: Undefined index: #file in theme_media_thumbnail() (line 288 of /drupal/sites/all/modules/media/includes/

Notice: Trying to get property of non-object in theme_media_thumbnail() (line 288 of /drupal/sites/all/modules/media/includes/

lalweil’s picture

Version:7.x-1.0-rc3» 7.x-1.1

This looks to also be a problem with PPT and PPTX files. I'm pretty sure it's going to crop up whenever there isn't explicitly an image file to work with. I did the Full release of 1.1 and this is still a problem.

aaronsnoswell’s picture

+1? As per his bug makes D7 + Media module completely useless for uploading pdf's. Any timeline on a fix for this? If I knew more about the module I'd look into it myself.

justinhough’s picture

The fix that I found only recently was that you have to set the file type settings under configuration. If you click on the "File types" under the Media section you will see a list of default media types. The one you want to update is "Application (mulitpurpose)". At least this was the one that I found on my install. Click "Manage file display" and check the box next to generic file. You should be under the default display when you do this. Save it and this should clear up the problem.

I had some default PDF icons show up, but at least I could see my PDF files in the thumbnail view.

mpgeek’s picture

Assigned:Unassigned» mpgeek
Status:Active» Postponed (maintainer needs more info)

Have any of you tried 7.x-1.2? I'm unable to reproduce with 7.x-1.2.

justinhough’s picture

My site was still using the 7.x.1.1. I haven't been able to test this on the 7.x-1.2 on a DEV environment.

seaarg’s picture

#4 post fixed my problem. Im using media 7.x-1.2

mpgeek’s picture

Status:Postponed (maintainer needs more info)» Closed (works as designed)
jayhawkfan75’s picture

Status:Closed (works as designed)» Active

I'm having this same issue.

I saw that all of my PDF's were in the list of files for the Media module, so I tried embedding one of them onto an article using the Media Browser within CKEditor. These are the versions of the Media module that I've tried this with:


When I try this, all that gets embedded is the large media icon for files, and it doesn't link to anything. I've tried selecting "Link", "Large", and "Original" from the drop-down within the media browser, but it never works.

This is what's in the source code when I select "Link":

And this is what's there if I select "Original":

The PDF file I'm testing out is only 5.67 KB, so file size is not an issue here. Isn't this functionality supposed to be part of this module? Thanks in advance for any help or direction.

developerweeks’s picture

Issue summary:View changes
Status:Active» Closed (works as designed)

I just had this exact problem. It took me 6 hours to track down the cause, which was that there were 2 versions of file_entity in the profile. The appropriate file_entity provides a default thumbnail for pdfs that the media module is expecting. I had a version of file_entity (1.x-dev instead of the 1.4 that was with the media module) that had a different schema number set, and had to do a reset of it in my system table to resolve. (UPDATE system SET schema_version = 7000 WHERE name = 'file_entity'; ) Drush updatedb.

Errors are gone now and it is working smooth for me.

eyn’s picture

I've been trying to get this thing to work with PDF and PPT files with no luck. I tried #10; had been using file_entity 1.4 all along.