I'm using the latest dev version of entity and I upgraded the media module to rc2 from a older dev version. I disabled all modules requiring it and when I run update.php I get the following fatal error:

An AJAX HTTP error occurred. HTTP Result Code: 200 Debugging information follows. Path: http://mydevsite.com/update.php?id=42342&op=do StatusText: OK ResponseText: Fatal error: Call to undefined function file_entity_update_7001() in /home/mysite/public_html/sites/all/modules/media/media.install on line 576

I have the file eneity module (not listed as a depency on rc2) and the newest dev version of entity, what am I missing that's causing this error?

Comments

aaron’s picture

Status: Active » Postponed (maintainer needs more info)

Actually, the file entity module should be listed as a dependency in RC2: http://drupalcode.org/project/media.git/blob/571d287e3dd29293a2bc45e75e7... . In any case, ensure that you're using the file entity module packaged with media, and not from its own project, as long as you're talking about version 1. Version 2 requires the external dependency.

Try installing that before running your update and see what happens.

sol roth’s picture

Hm.. I am now using file entity from the Media module RC2 - version 1, but its' still giving me the same fatal error:

It seems this is failing -

function media_update_7017() {
  // If the {file_display} table doesn't exist, then the File Entity module's
  // update functions will automatically take care of migrating the
  // configurations. However, if file_entity_update_7001() has already run
  // prior to media_update_7016(), run it again in order to capture those
  // configurations too.
  if (db_table_exists('file_display')) {
    file_entity_update_7001();
  }
}

Which is weird, because that function is present in file_entity.install in the file_entity folder in the media module and it's enabled.

function file_entity_update_7001() {
  $file_displays = variable_get('file_displays');
  if (!empty($file_displays)) {
    foreach ($file_displays as $file_type => $file_type_displays) {
      if (!empty($file_type_displays)) {
        foreach ($file_type_displays as $view_mode => $view_mode_displays) {
          if (!empty($view_mode_displays)) {
            foreach ($view_mode_displays as $formatter_name => $display) {
              if (!empty($display)) {
                db_merge('file_display')
                  ->key(array(
                    'name' => implode('__', array($file_type, $view_mode, $formatter_name)),
                  ))
                  ->fields(array(
                    'status' => isset($display['status']) ? $display['status'] : 0,
                    'weight' => isset($display['weight']) ? $display['weight'] : 0,
                    'settings' => isset($display['settings']) ? serialize($display['settings']) : NULL,
                  ))
                  ->execute();
              }
            }
          }
        }
      }
    }
  }
  variable_del('file_displays');
}
dmsmidt’s picture

I pasted the code from the file_entity.install update 7001 directly in the media.install update 7017 and ran the upgrade without further problem. Maybe the other file isn't referenced?

hyperglide’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

Going to close this topic on the following grounds:

  1. No activity for over 2 months.
  2. Media 1.x branch is now on RC3
  3. Per #3 issue was resolved.