PHP Fatal error: Class 'EntityCacheNodeController' not found in ncludes/common.inc on line 7697

If I disable the module on a running system and clear cache, I get the above error

It causes WSOD

CommentFileSizeAuthor
#9 entitycache-php_fatal_error-1786026-9.patch476 bytesfuerst
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

fuerst’s picture

Me too. It was a development machine so I solved it by replacing the complete database.
If that is not an option you may truncate table registry_file; in your database. See first comment in http://api.drupal.org/api/drupal/includes%21bootstrap.inc/function/regis...

phayes’s picture

Priority: Normal » Major

Marking as major priority as it blocks all tests from being run on a site.

Phizes’s picture

Registry Rebuild will probably also be able to help you if you are stuck with this issue, it's also just a workaround though.

bartlomiej’s picture

I have the same problem after disabling the module.

zuernBernhard’s picture

I had the same issue here. The reason was: Memcached. While i had flushed file_registry I still got this Error. After flushing memcached all went fine.

In my local Terminal (zsh on OSX) I use:
'echo "flush_all" | /bin/netcat 127.0.0.1 11211'

to flush memcached.

rooby’s picture

Issue summary: View changes

I'm not using memcache and so far drush rr and truncating registry_file table haven't helped.

[edit] Scratch that. My problem was user error.

quiron’s picture

Hi all,
is any reason to not including this to the uninstall process?

thanks

skwashd’s picture

@quiron if someone proposes a patch for adding something to hook_uninstall() I'll look at it.

fuerst’s picture

Running registry_update() should be enough because this will remove files from the registry table(s) which are no longer available because the module providing it got disabled.

fuerst’s picture

Status: Active » Needs review

Set issue to Needs review as well.

SocialNicheGuru’s picture

I no longer get the error

SocialNicheGuru’s picture

Status: Needs review » Reviewed & tested by the community
drumm’s picture

Priority: Major » Critical

Drupal.org nearly ran into this. It hit staging. Since this unexpectedly & swiftly takes down the site, marking it critical.

RobLoach’s picture

Should this also go in _enable/_install?

catch’s picture

catch’s picture

Status: Reviewed & tested by the community » Closed (duplicate)

I think it is, see you over there.

joelpittet’s picture

Title: PHP Fatal error: Class 'EntityCacheNodeController' not found in ncludes/common.inc on line 7697 » PHP Fatal error: Class 'EntityCacheNodeController' not found in includes/common.inc

I'm using both of these patches in production. (though my commit log message on why is not helpful, sorry)

philsward’s picture

The dev as of 2016-Aug-15 or later, should have the fixes necessary to circumvent this issue.

arunkmishra’s picture

I'm using these patches in production. helpful for me.

diff --git a/entitycache.module b/entitycache.module
index 66366e0..bd4c648 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 (!class_exists('EntityCacheControllerHelper')) {
+ require_once __DIR__ . '/includes/entitycache.entitycachecontrollerhelper.inc';
+}
+if (!class_exists('EntityCacheDefaultEntityController')) {
+ require_once __DIR__ . '/includes/entitycache.defaultentitycontroller.inc';
+}
+if (!class_exists('EntityCacheNodeController')) {
+ require_once __DIR__ . '/includes/entitycache.node.inc';
+}
+if (!class_exists('EntityCacheUserController')) {
+ require_once __DIR__ . '/includes/entitycache.user.inc';
+}