awesomemotive / all-in-one-seo-pack

All in One SEO plugin for WordPress SEO
https://aioseo.com
339 stars 155 forks source link

Robots.php error with PHP 8.1 #3201

Closed lkraider closed 2 years ago

lkraider commented 2 years ago

Exception:

mod_fcgid: stderr: PHP Warning:  Attempt to read property "robotsMeta" on null in /wp-content/plugins/all-in-one-seo-pack-pro/app/Common/Meta/Robots.php on line 276, referer: https://www.example.com/wp-admin/post.php?post=12977&action=elementor
mod_fcgid: stderr: PHP Fatal error:  Uncaught Error: Call to a member function all() on null in /wp-content/plugins/all-in-one-seo-pack-pro/app/Common/Meta/Robots.php:276, referer: https://www.example.com/wp-admin/post.php?post=12977&action=elementor

Stack Trace:

mod_fcgid: stderr: #0 /wp-content/plugins/all-in-one-seo-pack-pro/app/Common/Meta/Robots.php(210): AIOSEO\\Plugin\\Common\\Meta\\Robots->globalValues(Array, true)
mod_fcgid: stderr: #1 /wp-content/plugins/all-in-one-seo-pack-pro/app/Common/Meta/Robots.php(112): AIOSEO\\Plugin\\Common\\Meta\\Robots->post()
mod_fcgid: stderr: #2 /wp-content/plugins/all-in-one-seo-pack-pro/app/Pro/Meta/Robots.php(26): AIOSEO\\Plugin\\Common\\Meta\\Robots->meta()
mod_fcgid: stderr: #3 /wp-content/plugins/all-in-one-seo-pack-pro/app/Common/Views/main/meta.php(17): AIOSEO\\Plugin\\Pro\\Meta\\Robots->meta()
mod_fcgid: stderr: #4 /wp-content/plugins/all-in-one-seo-pack-pro/app/Common/Main/Head.php(173): require('/wp-content...')
mod_fcgid: stderr: #5 /wp-content/plugins/all-in-one-seo-pack-pro/app/Common/Main/Head.php(94): AIOSEO\\Plugin\\Common\\Main\\Head->output()
mod_fcgid: stderr: #6 /wp-includes/class-wp-hook.php(307): AIOSEO\\Plugin\\Common\\Main\\Head->init('')
mod_fcgid: stderr: #7 /wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters(NULL, Array)
mod_fcgid: stderr: #8 /wp-includes/plugin.php(476): WP_Hook->do_action(Array)
mod_fcgid: stderr: #9 /wp-includes/general-template.php(3042): do_action('wp_head')
(...)
arnaudbroes commented 2 years ago

Hey @lkraider,

Are you using Elementor? If so, we have a fix for this in our next update. In the meanwhile, you can easily fix this by going to the Search Appearance menu and just saving your settings once.

lkraider commented 2 years ago

Hi, yes, this is with elementor installed. Thanks for the workaround info! I'll close this issue for now.