Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I'm currently working on Views 6.x-2.16. I very frequently get the following fatal error when clearing caches:
PHP Fatal error: view::destroy() [<a href='view.destroy'>view.destroy</a>]: The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "views_plugin_display_default" 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 in obfuscated/views/includes/view.inc on line 1611
I suspect that this is due to an incompatibility with autoload. Some how, views attempts to destroy a view object that has an incomplete handler. A simple change to the destroy() method prevents this. Patch forthcoming.
Comment | File | Size | Author |
---|---|---|---|
#21 | views_plugin_display_extender_destroy_fix_D7-2040281-1.patch | 432 bytes | Michael Dajewski |
#3 | views-destroy_autoload-D7-2040281-3.patch | 566 bytes | znerol |
#1 | views-destroy_autoload-2040281-1.patch | 1.01 KB | grasmash |
Comments
Comment #1
grasmash CreditAttribution: grasmash at Acquia commentedAttaching patch rolled against 6.x-2.x-dev
Comment #2
TravisCarden CreditAttribution: TravisCarden commentedThis makes sense and seems to solve the problem without any potential for adverse side effects that I perceive.
Comment #3
znerol CreditAttribution: znerol commentedThis is #1 but without the first hunk removed. This makes the patch also apply to views 7.x-3.x. I hope this will help people suffering from #2171301: Get an error about "authcache_views_plugin_display_extender" after authcache_views is disabled (which I believe, I cannot really resolve cleanly over in Authcache).
Comment #4
cthshabel CreditAttribution: cthshabel commentedThis did not resolve the problem. Still had to rely on truncate views cache in mysql to clear things up.
Comment #5
dawehner@znerol
Did you had the change to reproduce the bug?
@cthshabel
Given that we might need to set the status to needs work? I'm not sure whether the problem of you is maybe something else.
Comment #6
znerol CreditAttribution: znerol commentedNo, I never hit that one. This seems to happen when people disable (or maybe simply remove) a module which provides a views extension and the views cache is not cleared properly for some reason. Perhaps this happens in combination with third-party cache implementations or some other combination of modules and settings.
In my opinion @grasmash fix makes a lot of sense. The views cache could get stale for any reason and protecting against incomplete objects on cleanup seems sensible.
Comment #7
DamienMcKennaThe patch should be added to 6.x-3.x first.
Comment #8
DamienMcKennaThe patch in #1 should be added to 6.x-2.x too.
Comment #11
dawehnerCommitted to both versions. Thank you! Thank you @DamienMcKenna
Comment #13
vadym.kononenko CreditAttribution: vadym.kononenko commentedI think D7 branches must to be updated as well.
Comment #14
jpwester CreditAttribution: jpwester commentedAgreed. I believe I'm running into something similar with a custom views plugin display extender and I see the is_object() check hasn't been added to the includes/view.inc file in D7. I can confirm that the patch in #3 does in fact fix my issue.
Comment #15
zalak.addweb CreditAttribution: zalak.addweb commentedComment #16
DamienMcKenna@prafull.panchori: Please stop adding the "views" tag to issues in the Views issue queue, it's redundant. Thanks.
Comment #17
DamienMcKennaComment #19
DamienMcKennaCommitted. Thanks all.
Comment #21
Michael Dajewski CreditAttribution: Michael Dajewski commentedDid encounter the issue again.
Thanks to #6.
I did some testing and found out the issue was happening when I had enabled Administration menu
in: admin_menu/admin_menu.map.inc LN: 139 where they call views_get_enabled_views().
I do attach the views_plugin_display_extender_destroy_fix_D7-2040281-1.patch which is almost a copy of views-destroy_autoload-D7-2040281-3.patch.