Skip to content

Yoast SEO 7.0: PHP notice when the language is set from the content #229

@Chrystll

Description

@Chrystll

Plugins activated

Polylang 2.3.2
Yoast SEO 7.0

Issue Description

I get a PHP notice/warning when visiting the front.
This issue happens only when the language is set from the content and with Yoast SEO 7.0 (no matter the Polylang version). I didn't reproduce the issue with the previous version of Yoast SEO 6.3.1

Steps to reproduce the issue

  1. Go to Languages > Settings > Url mdofications module: Select ' The language is set from content' (no matter is in plain or post name permalinks).

  2. Visit a page on the front: I get the PHP notice/warning below:

PHP Notice:  Undefined property: WPSEO_Frontend::$options in /git/polylang/modules/plugins/wpseo.php on line 32
PHP Stack trace:
PHP   1. {main}() /index.php:0
PHP   2. require() /index.php:17
PHP   3. wp() /wp-blog-header.php:16
PHP   4. WP->main() /wp-includes/functions.php:960
PHP   5. WP->query_posts() /wp-includes/class-wp.php:715
PHP   6. WP_Query->query() /wp-includes/class-wp.php:599
PHP   7. WP_Query->get_posts() /wp-includes/class-wp-query.php:3230
PHP   8. WP_Query->parse_query() /wp-includes/class-wp-query.php:1621
PHP   9. do_action_ref_array() /wp-includes/class-wp-query.php:1006
PHP  10. WP_Hook->do_action() /wp-includes/plugin.php:515
PHP  11. WP_Hook->apply_filters() /wp-includes/class-wp-hook.php:310
PHP  12. PLL_Choose_Lang_Content->parse_main_query() /wp-includes/class-wp-hook.php:286
PHP  13. PLL_Choose_Lang->home_language() /git/polylang/frontend/choose-lang-content.php:98
PHP  14. PLL_Choose_Lang_Content->set_language() /git/polylang/frontend/choose-lang.php:224
PHP  15. PLL_Choose_Lang->set_language() /git/polylang/frontend/choose-lang-content.php:36
PHP  16. do_action() /git/polylang/frontend/choose-lang.php:73
PHP  17. WP_Hook->do_action() /wp-includes/plugin.php:453
PHP  18. WP_Hook->apply_filters() /wp-includes/class-wp-hook.php:310
PHP  19. PLL_WPSEO->init() /wp-includes/class-wp-hook.php:288
PHP Warning:  array_merge(): Argument #1 is not an array in /git/polylang/modules/plugins/wpseo.php on line 32
PHP Stack trace:
PHP   1. {main}() /index.php:0
PHP   2. require() /index.php:17
PHP   3. wp() /wp-blog-header.php:16
PHP   4. WP->main() /wp-includes/functions.php:960
PHP   5. WP->query_posts() /wp-includes/class-wp.php:715
PHP   6. WP_Query->query() /wp-includes/class-wp.php:599
PHP   7. WP_Query->get_posts() /wp-includes/class-wp-query.php:3230
PHP   8. WP_Query->parse_query() /wp-includes/class-wp-query.php:1621
PHP   9. do_action_ref_array() /wp-includes/class-wp-query.php:1006
PHP  10. WP_Hook->do_action() /wp-includes/plugin.php:515
PHP  11. WP_Hook->apply_filters() /wp-includes/class-wp-hook.php:310
PHP  12. PLL_Choose_Lang_Content->parse_main_query() /wp-includes/class-wp-hook.php:286
PHP  13. PLL_Choose_Lang->home_language() /git/polylang/frontend/choose-lang-content.php:98
PHP  14. PLL_Choose_Lang_Content->set_language() /git/polylang/frontend/choose-lang.php:224
PHP  15. PLL_Choose_Lang->set_language() /git/polylang/frontend/choose-lang-content.php:36
PHP  16. do_action() /git/polylang/frontend/choose-lang.php:73
PHP  17. WP_Hook->do_action() /wp-includes/plugin.php:453
PHP  18. WP_Hook->apply_filters() /wp-includes/class-wp-hook.php:310
PHP  19. PLL_WPSEO->init() /wp-includes/class-wp-hook.php:288
PHP  20. array_merge() /git/polylang/modules/plugins/wpseo.php:32

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions