When enabled the views integration submodule, the following error comes:

Fatal error: 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 "metatag_views_plugin_display_extender_metatags" 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 /xxxxxx/views_plugin_display.inc on line 272

CommentFileSizeAuthor
#36 metatag-n2297647-36.patch504 bytesdamienmckenna

Comments

damienmckenna’s picture

Version: 7.x-1.0-beta9 » 7.x-1.x-dev

I presume this still affects the -dev codebase as the Views integration hasn't really been touched.

tahiticlic’s picture

Version: 7.x-1.x-dev » 7.x-1.0-beta9

Same problem using beta9 version.

damienmckenna’s picture

Version: 7.x-1.0-beta9 » 7.x-1.x-dev
greggles’s picture

Priority: Critical » Major
Status: Active » Postponed (maintainer needs more info)

I went to http://simplytest.me/project/metatag/7.x-1.0rc1 and installed a site.
I enabled views, metatag views and views ui.
I clicked around a bit, but was unable to get this error.

Downgrading priority until there are a set of simplified steps to repeat it.

When it happens it is critical...but if it doesn't happen often then the issue is not critical.

greggles’s picture

Amazingly enough, I experienced a similar but different error today:

PHP Fatal error: view::destroy(): The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "views_plugin_display_system" 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 /var/www/example.com/sites/all/modules/contrib/views/includes/view.inc on line 1991

I resolved it by clearing the views cache:

drush @site.alias php-eval "views_invalidate_cache();"
chems’s picture

Hello,

Just Clear views cache in Database AND/OR excute update.php (in the setting modify $update_free_access = TRUE )

bye

greggles’s picture

Category: Bug report » Support request
Status: Postponed (maintainer needs more info) » Fixed

@chems, in my case those weren't possible b/c I was getting the error before either of those ran.

I think this is "fixed" so updating the status. Please reopen (ideally with a set of steps to repeat the bug) if its not fixed.

Status: Fixed » Closed (fixed)

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

vbard’s picture

#5 helped me!

Jej’s picture

Thank you #5 :)

sneha.kamble’s picture

#5 solved my problem. Thanks.

sneha.kamble’s picture

#5 is not working for me... :(

sneha.kamble’s picture

#5 is not working for me... :(

theodorosploumis’s picture

If you cannot execute the drush command from #5 simple truncate the data from the cache_views table on your database.

sp_key’s picture

The steps to reproduce are the ones below:
1. Enable Views
2. Enable Meta Tag
3. Enable Meta Tag Views
4. Disable Meta Tag

The above error was displayed as soon as I went offline after step 4.
The problem is also visible on version 7.x-1.7

Dhara Shah’s picture

Issue summary: View changes

#5 solved my problem. Thanks greggles !

I had same issue like

PHP Fatal error: 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 "views_flag_refresh_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 in \sites\all\modules\contrib\views\plugins\views_plugin_display.inc on line 272
szt’s picture

Issue summary: View changes
goodboy’s picture

#5 solved, thank you

jdrefahl’s picture

If you experienced this error after you installed or uninstalled the Administrator Views module. You might want to reference the fix that worked for me here.

giorgosk’s picture

#5 helped to make the error dissapear
still looking at the admin_views problem as mentioned in #19

mulderjoe’s picture

#5 did the trick. Thanks a ton.

othermachines’s picture

Just got this error when disabling metatag_views via drush - metatag 7.x-1.7.

damienmckenna’s picture

ericjenkins’s picture

#5 worked for me, as well. Saved me a LOTT of time. Thank you!!!

damien_vancouver’s picture

Each time the error occurred a MySQL connection would get orphaned and left open. After a few days I overflowed the max connections on MySQL and the server crashed.

#5 fixed this for me too.. no more extra connections.

zied.ellouze’s picture

#5 solved my problem.
Thanks greggles !

PHP Fatal error:  view::destroy(): The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "views_plugin_display_system" 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 sites/all/modules/contrib/views/includes/view.inc on line 1998
Drush command terminated abnormally due to an unrecoverable error.                                                                                                                                                                               [error]
Error: view::destroy(): The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "views_plugin_display_system" 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 sites/all/modules/contrib/views/includes/view.inc, line 1998
biswajit roy’s picture

Hi greggles,

Thanks for your support, your suggestion worked for me. I have cleared the cache as follows:

function CUSTOM_MODULE_NAME_init() {
cache_clear_all('*', 'cache_views', TRUE);
}

Cheers,
Biswajit Roy

hitech3273’s picture

hello all i have faced this problem today i searched too much on net but no luck but here #5 Mr. greggles sorted this out
i just follow these steps and all clear my problem
1> go to admin
2> then "STRUCTURE"
3> "VIEWS"
4> then "SETTINGS" which is tab in views
5> then "Advanced" tab
Now here just click on "CLEAR VIEWS CACHE" Views caches data about tables, modules and views available, to increase performance. By checking this box, Views will skip this cache and always rebuild this data when needed. This can have a serious performance impact on your site.

and voila we sorted all problem with views

http://www.yourdomain.com/admin/structure/views/settings/advanced

vbard’s picture

#27 helped, thank you!

condesa’s picture

This is happening on Version: 7.x-1.18
I solved it in a database with:
TRUNCATE `cache_views`;
TRUNCATE `cache_views_data`;

dkmishra’s picture

I had same issue but with the views_ajax_overlay module enable but #5 help me to fix the issue. At local system, we can just use
drush php-eval "views_invalidate_cache();" instead of drush @site.alias php-eval "views_invalidate_cache();". Thanks a lot.

sj.suraj’s picture

I have found a fast and easy solution for views_plugin_display::destroy() problem. Just open this file
sites\all\modules\dependencies\views\plugins\views_plugin_display.inc and goto line number 272. Comment this line and flush all cache on your site and then uncomment the line. The problem will be solved.
Hope it will help you.

pinueve’s picture

+1 #28, thanks

entelechial’s picture

This is still an issue. I fixed it in the same way as #5, #28.

In case this helps anyone else find the issue and solution...

The steps that sp_key posted in #15 caused the same issue on my website. Disabling the Metatag Views module caused the issue, and precipitated...

"PDOException: SQLSTATE[HY000] [1040] Too many connections in lock_may_be_available() (line 165 of /home/sites/domain/path/includes/lock.inc)."

... because the "Fatal error: views_plugin_display::destroy()" was getting thrown every couple of seconds, and every time, it left a dead sleeping client connection thread in MySQL.

Which in turn broke everything that used the same MySQL server, until the threads were manually killed, or the MySQL server was manually reset. Setting a timeout (interactive_timeout=30 and wait_timeout=30) in MySQL killed the threads quickly enough to prevent the PDO Exception.

damienmckenna’s picture

Category: Support request » Task
Status: Closed (fixed) » Active

Ok, lets add a hook_disable() to the module to run views_invalidate_cache();.

damienmckenna’s picture

Status: Active » Needs review
StatusFileSize
new504 bytes

Does this help?

  • DamienMcKenna committed 9c4cd88 on 7.x-1.x
    Issue #2297647 by greggles, DamienMcKenna: Run views_invalidate_cache()...
damienmckenna’s picture

Status: Needs review » Fixed
Parent issue: » #2853846: Plan for Metatag 7.x-1.22 release

Committed.

Status: Fixed » Closed (fixed)

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

entelechial’s picture

Damien,

Sorry I didn't see check back sooner.

As far as I can tell, the views_invalidate_cache() in hook_disable() fixed the issue!

I went through the same steps to replicate the error after updating the metatag module, and disabling Metatag Views did not break the views cache.

Thanks!

Bakiyarajendiran’s picture

#28, thanks