Error: views_plugin_display::destroy() [views-plugin-display.destroy]: The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "authcache_views_plugin_display_extender" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide a __autoload() function to load the class definition (line 272 of ../sites/all/modules/views/plugins/views_plugin_display.inc).

I can not flush the cache at the moment.

Comments

znerol’s picture

Category: Bug report » Support request
Related issues: +#2040281: Views PHP Fatal error: view::destroy() on cache clear when autoload enabled

I believe this could be a bug in views (see #2040281: Views PHP Fatal error: view::destroy() on cache clear when autoload enabled). In order to work around this issue either incorporate the changes proposed in the linked issue into your views module or just make sure that the authcache_views_plugin_display_extender class is available while you are trying to clear the cache. You may enforce that by including the authcache_views_plugin_display_extender.inc from within settings.php using the following line:

include_once "sites/all/modules/authcache/modules/authcache_views/views/authcache_views_plugin_display_extender.inc";

Then you should be able to clear caches and afterwards you may remove the line again.

funature’s picture

as you suggest I add these two lines to settings.php, but it says this file can not be found

znerol’s picture

The file authcache_views_plugin_display_extender.inc is shipped with authcache. Therefore make sure that authcache is installed properly (you do not need to enable it, just make sure it is there). As an alternative you also may just download the file and place it into your drupal root directory. Then include it like this:

include_once DRUPAL_ROOT . "authcache_views_plugin_display_extender.inc";
funature’s picture

both methods give me the message Fatal error: Class 'views_plugin_display_extender' not found in ../sites/all/modules/authcache/modules/authcache_views/views/authcache_views_plugin_display_extender.inc on line 16

My question is why is the function of Authcache still called even if I disabled them, can I get it work again if I clean some table in database? If yes, how?

funature’s picture

after I clean the "cache_views" table in database manually, now I can flush the cache again. Is that possible to make this happen after "authcache_views" module is disabled? I mean with some new function in this module, like:

function authcache_views_disable() {
	db_query("DELETE FROM {cache_views};");
}
funature’s picture

Title: Get an error about "authcache_views_plugin_display_extender" after authcache is disabled » Get an error about "authcache_views_plugin_display_extender" after authcache_views is disabled
znerol’s picture

Status: Active » Closed (cannot reproduce)

Actually I tried to reproduce this issue but over here disabling Authcache Views does not lead to this behavior. I think that the Views API is properly implemented in Authcache Views and it is certainly not the responsibility of Authcache to mess with the Views Cache.

Thanks anyway for the report. If this problem should crop up repeatedly people will hopefully find this issue and may reopen it if necessary.

StryKaizer’s picture

Status: Closed (cannot reproduce) » Active

Same issue here.

Truncating cache_views fixed the error for me.

dibyadel’s picture

thanks alot. It worked for me

znerol’s picture

Status: Active » Postponed (maintainer needs more info)

I am trying to reproduce this to no avail. If anyone hits this again, then please provide a proper backtrace such that I can understand what is going on. Also try to describe the steps on how to reproduce the bug exactly, give information about the combination of modules, the PHP version, etc.

As per #1 I still believe this is a bug in views and not in authcache.

Please understand that the solution in #5 is not working for non-database caches and therefore cannot be included as is in Authcache Views.

cthshabel’s picture

Well, I had this issue occur on 4 separate servers that I use. Same error with flushing caches every time after disabling "Authcache Views" specifically.

Steps to reproduce:

1. Enable Authcache Views (and required modules)
2. Flush caches
3. Disable only Authcache Views
4. Error
5. Refresh Page
6. Flush caches
7. Error

Solution: truncate Views Cache table in database resolved things.

Thanks everyone.

znerol’s picture

@cthshabel: There is a patch in #2040281: Views PHP Fatal error: view::destroy() on cache clear when autoload enabled. Does it resolve this issue for you?

cthshabel’s picture

znerol, I assume that patch is also compatible with 7.x? It references 6.x there?

I have resolved the issue by truncating the tables, but for the sake of confirming a solution, let me repeat the steps to get the error and I will test with that patch if it is compatible with 7.x.

cthshabel’s picture

@znerol,

this did not resolve the problem. i had to still rely on truncating views cache to clear the errors and fix drush cc

znerol’s picture

Ok, can you give me clear step by step instructions on how to reproduce that? #11 does in fact not expose the problem for me when starting from a fresh drupal install.

jprstoney’s picture

Clearing the views cache in the database works for me. I have to clear it before disabling any module it seems. As long as I do that, I get no errors.

znerol’s picture

Status: Postponed (maintainer needs more info) » Fixed

Views patch referenced in #12 just got committed. This is now part of the views 7.x-3.x-dev and will be included in the next stable release (likely 7.x-3.12).

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

vadym.kononenko’s picture

Status: Closed (fixed) » Postponed (maintainer needs more info)

https://www.drupal.org/commitlog/commit/1174/7fb3fd65f1dec47c15bee0bd6c5... - June 25, 2015 9:26 - Commit 7fb3fd6 on 6.x-3.x
https://www.drupal.org/commitlog/commit/1174/8c7e365739e480a44889e862ffa... - June 25, 2015 12:28 - Commit 8c7e365 on 6.x-2.x

You are wrong. It was commited into 6.x branches only.

znerol’s picture

Status: Postponed (maintainer needs more info) » Fixed

I cannot do anything about that in Authcache, thus closing this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.