Fatal Error On breadcrumbs-generator.php with PHP 8
-
PHP Version: 8.0
Host: WPEngine
Error Message:
PHP Fatal error: Uncaught TypeError: array_keys(): Argument #1 ($array) must be of type array, bool given in /MY/PATH/TO/MY_INSTALL/wp-content/plugins/wordpress-seo/src/generators/breadcrumbs-generator.php:194\nStack trace:\n#0 /MY/PATH/TO/MY_INSTALL/wp-content/plugins/wordpress-seo/src/generators/breadcrumbs-generator.php(194): array_keys(false)\n#1 /MY/PATH/TO/MY_INSTALL/wp-content/plugins/wordpress-seo/src/presentations/indexable-presentation.php(749): Yoast\\WP\\SEO\\Generators\\Breadcrumbs_Generator->generate(Object(Yoast\\WP\\SEO\\Context\\Meta_Tags_Context))\n#2 /MY/PATH/TO/MY_INSTALL/wp-content/plugins/wordpress-seo/src/presentations/abstract-presentation.php(64): Yoast\\WP\\SEO\\Presentations\\Indexable_Presentation->generate_breadcrumbs()\n#3 /MY/PATH/TO/MY_INSTALL/wp-content/plugins/wordpress-seo/src/generators/schema/breadcrumb.php(33): Yoast\\WP\\SEO\\Presentations\\Abstract_Presentation->__get('breadcrumbs')\n#4 /MY/PATH/TO/MY_INSTALL/wp-content/plugins/wordpress-seo/src/generators/schema-generator.php(128): Yoast\\WP\\SEO\\Generators\\Schema\\Breadcrumb->generate()\n#5 /MY/PATH/TO/MY_INSTALL/wp-content/plugins/wordpress-seo/src/generators/schema-generator.php(76): Yoast\\WP\\SEO\\Generators\\Schema_Generator->generate_graph(Array, Object(Yoast\\WP\\SEO\\Context\\Meta_Tags_Context))\n#6 /MY/PATH/TO/MY_INSTALL/wp-content/plugins/wordpress-seo/src/presentations/indexable-presentation.php(738): Yoast\\WP\\SEO\\Generators\\Schema_Generator->generate(Object(Yoast\\WP\\SEO\\Context\\Meta_Tags_Context))\n#7 /MY/PATH/TO/MY_INSTALL/wp-content/plugins/wordpress-seo/src/presentations/abstract-presentation.php(64): Yoast\\WP\\SEO\\Presentations\\Indexable_Presentation->generate_schema()\n#8 /MY/PATH/TO/MY_INSTALL/wp-content/plugins/wordpress-seo/src/presenters/schema-presenter.php(60): Yoast\\WP\\SEO\\Presentations\\Abstract_Presentation->__get('schema')\n#9 /MY/PATH/TO/MY_INSTALL/wp-content/plugins/wordpress-seo/src/presenters/schema-presenter.php(44): Yoast\\WP\\SEO\\Presenters\\Schema_Presenter->get()\n#10 /MY/PATH/TO/MY_INSTALL/wp-content/plugins/wordpress-seo/src/integrations/front-end-integration.php(324): Yoast\\WP\\SEO\\Presenters\\Schema_Presenter->present()\n#11 /MY/PATH/TO/MY_INSTALL/wp-includes/class-wp-hook.php(307): Yoast\\WP\\SEO\\Integrations\\Front_End_Integration->present_head('')\n#12 /MY/PATH/TO/MY_INSTALL/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters('', Array)\n#13 /MY/PATH/TO/MY_INSTALL/wp-includes/plugin.php(474): WP_Hook->do_action(Array)\n#14 /MY/PATH/TO/MY_INSTALL/wp-content/plugins/wordpress-seo/src/integrations/front-end-integration.php(298): do_action('wpseo_head')\n#15 /MY/PATH/TO/MY_INSTALL/wp-includes/class-wp-hook.php(307): Yoast\\WP\\SEO\\Integrations\\Front_End_Integration->call_wpseo_head('')\n#16 /MY/PATH/TO/MY_INSTALL/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters(NULL, Array)\n#17 /MY/PATH/TO/MY_INSTALL/wp-includes/plugin.php(474): WP_Hook->do_action(Array)\n#18 /MY/PATH/TO/MY_INSTALL/wp-includes/general-template.php(3042): do_action('wp_head')\n#19 /MY/PATH/TO/MY_INSTALL/wp-content/themes/lsne/header.php(19): wp_head()\n#20 /MY/PATH/TO/MY_INSTALL/wp-includes/template.php(770): require_once('/nas/content/li...')\n#21 /MY/PATH/TO/MY_INSTALL/wp-includes/template.php(716): load_template('/nas/content/li...', true, Array)\n#22 /MY/PATH/TO/MY_INSTALL/wp-includes/general-template.php(48): locate_template(Array, true, true, Array)\n#23 /MY/PATH/TO/MY_INSTALL/wp-content/themes/lsne/front-page.php(10): get_header()\n#24 /MY/PATH/TO/MY_INSTALL/wp-includes/template-loader.php(106): include('/nas/content/li...')\n#25 /MY/PATH/TO/MY_INSTALL/wp-blog-header.php(19): require_once('/nas/content/li...')\n#26 /MY/PATH/TO/MY_INSTALL/index.php(17): require('/nas/content/li...')\n#27 {main}\n thrown in /MY/PATH/TO/MY_INSTALL/wp-content/plugins/wordpress-seo/src/generators/breadcrumbs-generator.php on line 194, referer: https://MY_SITE.com/wp-login.php?loggedout=true&wp_lang=en_USQUICK FIX: change line 194 in
/wp-content/plugins/wordpress-seo/src/generators/breadcrumbs-generator.phpto read:return \array_map( $filter_callback, ( array ) $crumbs, \array_keys( ( array ) $crumbs ) );
The topic ‘Fatal Error On breadcrumbs-generator.php with PHP 8’ is closed to new replies.