"Detect browser language" sometimes setting NULL language
-
Permalinks: Post name
Static Front Page? No
Polylang Settings:
-The language is set from content
-Hide URL language information for default language (Checked)
-Remove /language/ in pretty permalinks
-Detect browser language (Checked)Main symptoms:
Block of notices thrown at top of pageNotice: Trying to get property of non-object in \wp-content\plugins\polylang\frontend\choose-lang.php on line 65 Notice: Trying to get property of non-object in \wp-content\plugins\polylang\frontend\choose-lang.php on line 52 Notice: Trying to get property of non-object in \wp-content\plugins\polylang\frontend\choose-lang.php on line 53 Notice: Trying to get property of non-object in \wp-content\plugins\polylang\frontend\frontend-filters.php on line 74 Notice: Trying to get property of non-object in \wp-content\plugins\polylang\frontend\frontend-filters.php on line 74 Notice: Trying to get property of non-object in \wp-content\plugins\polylang\frontend\choose-lang.php on line 163 Notice: Trying to get property of non-object in \wp-content\plugins\polylang\frontend\choose-lang.php on line 171 Notice: Trying to get property of non-object in \wp-content\plugins\polylang\include\links.php on line 148 Notice: Trying to get property of non-object in \wp-content\plugins\polylang\include\links.php on line 148 ? Notice: Trying to get property of non-object in \wp-content\plugins\polylang\frontend\frontend-filters.php on line 74 prefix="og: https://ogp.me/ns#"> Notice: Trying to get property of non-object in \wp-content\plugins\polylang\frontend\frontend-filters.php on line 74 Notice: Trying to get property of non-object in \wp-content\plugins\polylang\frontend\frontend-filters.php on line 74 Notice: Trying to get property of non-object in \wp-content\plugins\polylang\include\links.php on line 148 Notice: Trying to get property of non-object in \wp-content\plugins\polylang\include\links.php on line 148 Notice: Trying to get property of non-object in \wp-content\plugins\polylang\frontend\frontend-filters.php on line 74 Notice: Trying to get property of non-object in \wp-content\plugins\polylang\include\plugins-compat.php on line 116 Notice: Trying to get property of non-object in \wp-content\plugins\polylang\include\plugins-compat.php on line 116 Notice: Trying to get property of non-object in \wp-content\plugins\polylang\include\links.php on line 148 Notice: Trying to get property of non-object in \wp-content\plugins\polylang\include\links.php on line 148 Notice: Trying to get property of non-object in \wp-content\plugins\polylang\frontend\frontend-filters.php on line 74
Warning thrown by Events Manager plugin (if present)
Warning: array_key_exists(): The first argument should be either a string or an integer in \wp-content\plugins\events-manager\events-manager.php on line 410
wp_nav_menu falls back to wp_page_menu
wp_page_menu passes $args as an array, not object, so this also caused a string of notices from my custom Nav WalkerNow the tricky part is I honestly have no idea how this happens “in the wild.” It was happening to client intermittently over the course of a couple months, always after they updated the site (I think the “intermittent” part is due to the W3TC plugin, but the issue still occurs with all plugins disabled) I’m as yet unable to duplicate the issue using their same steps; the only way I’ve been able to encounter it is by manually changing the value of the “pll_language” cookie to an empty string.
Unchecking “Detect browser language” does prevent the issue from happening.
- The topic ‘"Detect browser language" sometimes setting NULL language’ is closed to new replies.