Website was doing okay for months. But probably after some plugin update I get a fatal error.
A blank page with a server error 500 message appears. After checking my apache error log I notice this error:
" Got error 'PHP message: PHP Fatal error: Uncaught TypeError: Argument 1 passed to WPSEO_Admin_Bar_Menu::get_post_score() must be an instance of WP_Post, instance of Timber\Post given, called in /home/runcloud/webapps/jungle-1/www/wp-content/plugins/wordpress-seo/inc/class-wpseo-admin-bar-menu.php on line 144 and defined in /home/runcloud/webapps/jungle-1/www/wp-content/plugins/wordpress-seo/inc/class-wpseo-admin-bar-menu.php:482\nStack trace:\n#0 /home/runcloud/webapps/jungle-1/www/wp-content/plugins/wordpress-seo/inc/class-wpseo-admin-bar-menu.php(144): WPSEO_Admin_Bar_Menu->get_post_score(Object(Timber\Post))\n#1 /home/runcloud/webapps/jungle-1/www/wp-content/plugins/wordpress-seo/inc/class-wpseo-admin-bar-menu.php(60): WPSEO_Admin_Bar_Menu->add_root_menu(Object(WP_Admin_Bar))\n#2 /home/runcloud/webapps/jungle-1/www/wp-includes/class-wp-hook.php(286): WPSEO_Admin_Bar_Menu->add_menu(Object(WP_Admin_Bar))\n#3 /home/runcloud/webapps/jungle-1/www/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array)\n#4 /...\n'"
Disabling the Yoast plugin solves the problem for now.
Timber (latest)
Yoast (latest)
Tested with theme: custom child theme based on the default timber starter theme.
Thanks for reporting! We've already created a fix for this issue though, as it had been reported before. The fix for this is scheduled to be in 8.1, which is planned to be released tomorrow. Therefore, I'm going to close this.
I've just updated to 8.1 on 2 environments and the issue persists (now with get_post_focus_keyword()).
I can confirm still not fixed!
Same with me. Problem still exist!
Thanks for following up. Please check issue https://github.com/Yoast/wordpress-seo/issues/10825 and https://github.com/Yoast/wordpress-seo/issues/10836 for future reference, since this one is closed and is technically a different error.
Confirm still not fixed, tossing more errors than 8.0 for me.
Please solve this issue.
I solved temporaly add this from functions.php:
show_admin_bar(false);
Just putting this in here for anyone who gets here via google rather than the other issue pages: As mentioned in the #10825 the non-code workaround (if you can get into WP-Admin backend) until the issue is resolved is to toggle "Admin bar menu" off in Yoast under SEO > General > Features. h/t @andrejpavlovic
This issue was only present on my front-page.php template.
To resolve it I replaced new Timber\PostQuery( ... ) with Timber::get_posts( ... ).
Same here on version 8.3
Still getting this with 9.0.1
only on my homepage... would prefer not modifying my code...
2018/10/24 02:25:11 [error] 2627#2627: *13070 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught TypeError: Argument 1 passed to WPSEO_Admin_Bar_Menu::get_post_focus_keyword() must be an instance of WP_Post, instance of Timber\Post given, called in /PATH/web/app/plugins/wordpress-seo/inc/class-wpseo-admin-bar-menu.php on line 204 and defined in /PATH/web/app/plugins/wordpress-seo/inc/class-wpseo-admin-bar-menu.php:474
Most helpful comment
Just putting this in here for anyone who gets here via google rather than the other issue pages: As mentioned in the #10825 the non-code workaround (if you can get into WP-Admin backend) until the issue is resolved is to toggle "Admin bar menu" off in Yoast under SEO > General > Features. h/t @andrejpavlovic