Hello,

Class name must be a valid object or a string Class name must be a valid object or a string in common.inc, line 7848

Here's the function in question:

/**
 * Gets the entity controller for an entity type.
 *
 * @return DrupalEntityControllerInterface
 *   The entity controller object for the specified 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'];
    $controllers[$entity_type] = new $class($entity_type); //line 7848 that barfs
  }
  return $controllers[$entity_type];
}

I put some watchdog debug code in there and I find that the entity causing the error is fluxservice_service, and that $class is undefined.

Funny thing, this happens on prod but not on local. I'm checking the libraries and stuff, but when I run the following I get no results:

entity_get_info($entity_type = 'fluxservice_service');

So that would be a problem. I'm updating the libraries and I'll do some digging to see what's up. Sort of mysterious.

Comments

glass.dimly’s picture

So it seems that this function is returning nothing, but only when called in a CLI environment (PHP 5.4.4 with latest drush).
fluxservice_discover_plugins('fluxservice_entity');

Don't know why. Moving on for the day to other development priorities. May get back to this thread.

-jj

glass.dimly’s picture

Status: Active » Closed (fixed)

This was caused by accidentally inserted whitespace at the top of a custom module.