• Resolved devdevdev998

    (@devdevdev998)


    I am getting this fatal error

    PHP Fatal error: Uncaught TypeError: array_merge(): Argument #1 must be of type array, false given in /www/website_redacted/public/wp-content/plugins/wordpress-seo/src/user-meta/user-interface/additional-contactmethods-integration.php:54
    Stack trace: 0 /www/website_redacted/public/wp-content/plugins/wordpress-seo/src/user-meta/user-interface/additional-contactmethods-integration.php(54): array_merge(false, Array)

    I’m using latest version 23.9 of Yoast as well as WP and all plugins

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter devdevdev998

    (@devdevdev998)

    /**
    * Updates the contactmethods with an additional set of social profiles.
    *
    * These are used with the Facebook author, rel="author", Twitter cards implementation, but also in the
    sameAs schema attributes.
    *
    * @param array<string, string> $contactmethods Currently set contactmethods.
    *
    * @return array<string, string> Contactmethods with added contactmethods.
    */
    public function update_contactmethods( $contactmethods ) {
    $additional_contactmethods = $this->additional_contactmethods_collector->get_additional_contactmethods_objects();
    if( is_array($contactmethods) ){
    return \array_merge( ( $contactmethods ?? [] ), $additional_contactmethods );
    }
    else{
    return [];
    }

    }

    In wordpress-seo/src/user-meta/user-interface/additional-contactmethods-integration.php the return should be updated to solve the error. This is a quick and easy appaorach, but does the trick. Is there anything I can do to get a fix like this into Yoast core?

    Plugin Support Jose Varghese

    (@josevarghese)

    Hi @devdevdev998

    As you have noticed the issue and fixed it within the code, you can submit it as a patch so that our development can review it and merge it into the Yoast SEO plugin code. You can read more on how to contribute to the Yoast SEO plugin here

    As the fatal error does not occur on a fresh install of the Yoast SEO plugin, it may occur on a specific setup, case, or by another plugin or theme. So, I would recommend you submit more details within the PR on how to reproduce this issue, as it will help our developers review it more easily.

    Thanks in advance.

    • This reply was modified 1 year, 4 months ago by Jose Varghese. Reason: Removed the html tag
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Fatal Error’ is closed to new replies.