diff --git a/entity_boxes.module b/entity_boxes.module index 880f315..a4bc251 100644 --- a/entity_boxes.module +++ b/entity_boxes.module @@ -513,9 +513,18 @@ class BoxEntityTypeController extends EntityAPIControllerExportable { * Implements hook_boxes_plugins(). */ function entity_boxes_boxes_plugins() { + static $last_info = array(); $info = array(); // only do next part if entity_boxes_type table already exists (e.g., not during install) if (db_table_exists('entity_boxes_type')) { + // Catch the condition that module is being enabled, registery is being + // rebuilt but schema is not installed. + // @see https://www.drupal.org/node/1311820 + include_once DRUPAL_ROOT . '/includes/install.inc'; + if ((module_exists('taxonomy') && drupal_get_installed_schema_version('taxonomy') == SCHEMA_UNINSTALLED) + || (module_exists('rdf') && drupal_get_installed_schema_version('rdf') == SCHEMA_UNINSTALLED)) { + return $last_info; + } // force clear of entity cache so custom box types are available // otherwise we will crash when module is installed/enabled // NOTE: Do not call anything related to entity_boxes_get_types before @@ -538,6 +547,7 @@ function entity_boxes_boxes_plugins() { ), ); } + $last_info = $info; } return $info;