Using Media 7.x-1.x-dev from May, 26th and Styles 7.x-2.0-alpha8 on Drupal 7.2, I get the following error when I try to upload a file or browse the files library :

PHP Fatal error: Call to undefined function file_view_file() in /docroot/sites/all/modules/media/media.module on line 1055.

Comments

steinmb’s picture

Hi
This comes from the sub-module, file_entity module, the function is in file_entity.file_api.inc and that file get's included in "file_entity.module"

/**
 * As part of extending Drupal core's file entity API, this module adds some
 * functions to the 'file' namespace. For organization, those are kept in the
 * 'file_entity.file_api.inc' file.
 */
require_once dirname(__FILE__) . '/file_entity.file_api.inc';

I do not know what causes this, but I have also had code braking in media and 3-part modules like media_youtube/vimeo that are finding/loading these include files. Anyone willing to shed some light on issues like this, is this a core thing?

mrf’s picture

Looking at the info file it looks like file_entity is now a dependency for Media. I got this error when updating the dev branch through Git without first uninstalling the module.

Enabling file_entity removed the error message for me.

gollyg’s picture

Sounds like this is no longer an issue, unless there is an issue around the upgrade path?

dave reid’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.