diff --git a/entitycache.module b/entitycache.module index 66366e0..cc334fd 100644 --- a/entitycache.module +++ b/entitycache.module @@ -212,3 +212,23 @@ function entitycache_user_logout($account) { function entitycache_user_login(&$edit, $account) { cache_clear_all($account->uid, 'cache_entity_user'); } + +/** + * Workaround for update 7.x-1.3 and later breaking existing sites, since the + * class autoloader cannot find the classes previously defined in this file but + * now are moved into individual files under 'includes' folder. + * + * @see https://www.drupal.org/node/2441965#comment-10558568 + */ +if (!drupal_autoload_class('EntityCacheControllerHelper')) { + include('includes/entitycache.entitycachecontrollerhelper.inc'); +} +if (!drupal_autoload_class('EntityCacheDefaultEntityController')) { + include('includes/entitycache.defaultentitycontroller.inc'); +} +if (!drupal_autoload_class('EntityCacheNodeController')) { + include('includes/entitycache.node.inc'); +} +if (!drupal_autoload_class('EntityCacheUserController')) { + include('includes/entitycache.user.inc'); +}