• Resolved fob

    (@fob)


    Can not upgrade client system from outdated PHP (7.x) as Yoast SEO is causing a critical error on posts in custom post types. Debugging brings up the following error for Yoast Breadcrumbs (using PHP 8 or higher versions):

    Fatal error: Uncaught Error: Yoast\WP\SEO\Generators\Breadcrumbs_Generator::Yoast\WP\SEO\Generators\{closure}(): Argument #1 ($ancestor) must be of type Yoast\WP\SEO\Models\Indexable, bool given
    in …/staging…de/wp-content/plugins/wordpress-seo/src/generators/breadcrumbs-generator.php on line 141

    (Works fine, if the plugin is deactivated.)

    • This topic was modified 1 year, 11 months ago by fob.
    • This topic was modified 1 year, 11 months ago by fob.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Maybellyne

    (@maybellyne)

    Hello @fob

    I’m sorry about the breadcrumbs fatal error you experienced after upgrading to PHP 8. First, can you check if the site is using either the wpseo_breadcrumb_links or wpseo_breadcrumb_single_link_info filter?

    Thread Starter fob

    (@fob)

    Thank you for asking. The site is using the standard function “yoast_breadcrumb()” like this: “yoast_breadcrumb(‘<div class=”the-bc-class”>’, ‘</div>’). Yoast admin configurations, no additional filters in form of functions for filtering the visual output of breadcrumbs on posts, archives or pages.

    Plugin Support Maybellyne

    (@maybellyne)

    Hello Fob,

    Thanks for the feedback. I asked because if the wpseo_breadcrumb_links filter is misused, according to our developers, it may cause fatal errors on PHP 8.0+. Our code expects type Indexable for the items of an array resulting from a filter. You can take a look at a previous GitHub discussion here.

    However, the issue is still being investigated internally. Please keep an eye on our changelog for plugin release updates.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Critical Breadcrumb Error (PHP 8)’ is closed to new replies.