1

I am migrating a site hosted on on Drupal 7.22, apache 2.2.22aa and php 5.6.9 from one linux server to another lunx server. I did a back up of mysql and apache htdocs folder and extract it on the destination server. But when I lunched the page on the server, I am getting the following error:

Fatal error: Class name must be a valid object or a string in .../common.inc on line 7924

I enabled the debug as below

/*
 * Get the entity controller class for an entity type.
 */
function entity_get_controller($entity_type) {
  $controllers = &drupal_static(__FUNCTION__, array());
  if (!isset($controllers[$entity_type])) {
    $type_info = entity_get_info($entity_type);
    $class = $type_info['controller class'];

    // add debug.
    if(gettype($class) == 'string' || gettype($class) == 'object') {
      $controllers[$entity_type] = new $class($entity_type);
    } else  {
      print_r(debug_backtrace());
    }
    $controllers[$entity_type] = new $class($entity_type);
  }
  return $controllers[$entity_type];
}

Now I am getting the error as

Array ( [0] => Array ( [file] => ../includes/common.inc [line] => 7891 [function] => entity_get_controller [args] => Array ( [0] => node ) ) [1] => Array ( [file] => ../modules/node/node.module [line] => 952 [function] => entity_load [args] => Array ( [0] => node [1] => Array ( [0] => 15 ) [2] => Array ( ) [3] => ) ) [2] => Array ( [file] => ../modules/node/node.module [line] => 971 [function] => node_load_multiple [args] => Array ( [0] => Array ( [0] => 15 ) [1] => Array ( ) [2] => ) ) [3] => Array ( [file] => ../includes/menu.inc [line] => 593 [function] => node_load [args] => Array ( [0] => 15 ) ) [4] => Array ( [file] => ../includes/menu.inc [line] => 761 [function] => _menu_load_objects [args] => Array ( [0] => Array ( [path] => node/% [load_functions] => a:1:{i:1;s:9:"node_load";} [to_arg_functions] => [access_callback] => node_access [access_arguments] => a:2:{i:0;s:4:"view";i:1;i:1;} [page_callback] => node_page_view [page_arguments] => a:1:{i:0;i:1;} [delivery_callback] => [fit] => 2 [number_parts] => 2 [context] => 0 [tab_parent] => [tab_root] => node/% [title] => [title_callback] => node_page_title [title_arguments] => a:1:{i:0;i:1;} [theme_callback] => [theme_arguments] => a:0:{} [type] => 6 [description] => [position] => [weight] => 0 [include_file] => ) [1] => Array ( [0] => node [1] => 15 ) ) ) [5] => Array ( [file] => ../includes/menu.inc [line] => 472 [function] => _menu_translate [args] => Array ( [0] => Array ( [path] => node/% [load_functions] => a:1:{i:1;s:9:"node_load";} [to_arg_functions] => [access_callback] => node_access [access_arguments] => a:2:{i:0;s:4:"view";i:1;i:1;} [page_callback] => node_page_view [page_arguments] => a:1:{i:0;i:1;} [delivery_callback] => [fit] => 2 [number_parts] => 2 [context] => 0 [tab_parent] => [tab_root] => node/% [title] => [title_callback] => node_page_title [title_arguments] => a:1:{i:0;i:1;} [theme_callback] => [theme_arguments] => a:0:{} [type] => 6 [description] => [position] => [weight] => 0 [include_file] => ) [1] => Array ( [0] => node [1] => 15 ) ) ) [6] => Array ( [file] => ../includes/menu.inc [line] => 1755 [function] => menu_get_item [args] => Array ( ) ) [7] => Array ( [file] => ../includes/menu.inc [line] => 1770 [function] => menu_get_custom_theme [args] => Array ( [0] => 1 ) ) [8] => Array ( [file] => ../includes/common.inc [line] => 5292 [function] => menu_set_custom_theme [args] => Array ( ) ) [9] => Array ( [file] => ../includes/bootstrap.inc [line] => 2212 [function] => _drupal_bootstrap_full [args] => Array ( ) ) [10] => Array ( [file] => ../index.php [line] => 25 [function] => drupal_bootstrap [args] => Array ( [0] => 7 ) ) )  
1
  • Dumping a stack trace (especially one that isn't indented) isn't going to help anyone discover your problem. You need to find the class in question and understand why Drupal can't find it. dpm or print_r $class instead.
    – Shawn Conn
    Aug 31 '15 at 21:26

Browse other questions tagged or ask your own question.