Community

Fatal PHP error when trying to edit media gallery pages or add media

This is manifest across multiple sites on a multi-site installation, and it appears that somehow something related to the media module got hosed. When I try to upload new media to an existing gallery page it just hangs, though the media did get uploaded. If I try to add media from the library I get an "error getting media" popup. If I try to edit a gallery page I get a server 500 error. I can edit "all galleries" and I can edit media within a gallery, just cannot edit the gallery page itself or add new media to it. All existing media displays just fine.

The PHP error that pops up in the log looks like this:

[25-Nov-2012 19:07:07] PHP Fatal error: Call to undefined function file_info_file_types() in /home2/spinland/public_html/drupal7/sites/all/modules/media/media.module on line 1063

I've tried re-uploading all the modules on the server to make sure nothing got deleted, and have disabled and re-enabled Media Gallery on different sites, and nothing seems to help. I'm hoping there's some kind of configuration reset or something I can do to get this working again? I don't understand why it suddenly quit working; it was working fine for months.

If it helps, here's the cited bit of code from media.module:

function media_get_thumbnail_preview($file, $link = NULL) {
// If a file has an invalid type, allow file_view_file() to work.
if (!file_info_file_types($file->type)) { //////////////////////// line 1063
$file->type = media_get_type($file);
}

Many thanks in advance!

Comments

Okay, this is what I've tried

Okay, this is what I've tried since I posted above...

I restored one of the sites from a database backup made before this trouble started.

I reinstalled Drupal 7.17 core.

I replaced the contents of sites/all with that from another multi-site installation where the media uploads work fine.

I created a new Drupal site and gave it a media gallery.

Nothing worked. In all cases I am still unable to upload media, nor edit a gallery that already has media in it. I still get the PHP error I cited above.

Is there anyone who has an idea what could be happening here?

sounds like a permission

sounds like a permission problem (maybe!) double check the permissions on the files folder.

This is affecting six

This is affecting six different sites on the same multi-site installation. The permissions are 755 for all the files folders. The media are getting uploaded just fine, but then they cannot be accessed. If I try to add media from the library I get an "error getting media" popup, and again a fatal PHP error in the media module.

what is the file type? Try it

what is the file type? Try it with a youtube clip and see what happens. Shouldn't sites/default/files be 777?

When I try a youtube clip I

When I try a youtube clip I just get a blank overlay and it hangs until I refresh the page. This multi-site was working fine for months, this problem just cropped up recently. I noticed it for the first time yesterday. I was uploading content as recently as the 17th.

The media doesn't get

The media doesn't get uploaded to default/files, each site has its own files folder. /sites/example.com/files.

/sites/example.com/files hmm

/sites/example.com/files hmm still think the files permission should be 777 -R, could be wrong, just my 2 cents worth. Good luck!

Since the files are actually

Since the files are actually getting uploaded there doesn't seem to be any sort of write issues. Just to be sure I changed one of the sites' files folder to 777 and tried to edit one of the gallery pages: same error. Thanks anyway!

Latest Test

I migrated one of the affected sites to a different hosting account with the same company, under a new domain name, and now gallery page edits and media uploads are working. Does this sound like some kind of PHP or MySQL issue with my host provider?

have you got access to your

have you got access to your php.ini file? I know the media module works a treat for me, so yes you are probably correct in thinking it is a php issue, doubt very much it is a mysql config error. Any clues in the apache log files?

It's on a Hostmonster server,

It's on a Hostmonster server, all I think I get are the PHP errors. At least that's all that turns up when I try to get error logs via cpanel. The error that comes up every time I try to edit a gallery page is the same one I posted above:

[26-Nov-2012 08:35:43] PHP Fatal error: Call to undefined function file_info_file_types() in /home2/spinland/public_html/drupal7/sites/all/modules/media/media.module on line 1063

I have my onw php.ini file in

I have my own php.ini file in my home directory, but again all this worked just fine less than a week ago and I haven't made any changes to it. I tried deleting it this morning but it made no difference.

I was online with Hostmonster tech support last night and they said it was a Drupal issue and washed their hands.

Hostmonster suck, get a vps!

Hostmonster suck, get a vps! Sorted!

Finally Solved

It's now clear than I missed something when I re-installed, either the modules or the core. This time I went in from the command line and made doubly sure everything that wasn't site specific was deleted and then did another full re-install of core and the modules.

I don't know what got corrupted, or how, but now it appears as though the media module is again working properly.

Found the culprit!

It's the November 18 update to the File entity (fieldable files) module. After I did the latest full re-install, that module wanted to be updated; when I did so all the sites were again broken. Reverting to the last version of this module fixed it again.

I've logged a bug report with that module's page.

And in the end it's my fault.

I never saw this disclaimer:

"This module is not compatible with Media 1.x. You must use the File entity module that is included with Media 1.x and not this separate project. This is only for use with Media 2.x."

Media Gallery only currently works with Media 1.x. I should never have included this module.

glad you got it sorted!

glad you got it sorted!

This was the problem! I

This was the problem! I encountered the same error message on my system. I accidentally updated from file_entity 7.x-2.0-unstable6 to file_entity 7.x-2.0-unstable7. Going back to the previous version made things work again. Thank you for the pointer!