0

I am having an issue debugging what appears to be a WP core issue.

I am observing the following behavior when attempting to edit menus, see below for context

wp menu error

I checked the error logs and the following error is logged when edit menu page is loaded

PHP Fatal error:  Uncaught Error: Attempt to assign property "posts_page" on null in ../../../wp-admin/includes/nav-menu.php:406\nStack trace:\n#0 ../../../wp-admin/includes/template.php(1536): wp_nav_menu_item_post_type_meta_box(NULL, Array)\n#1 ../../../wp-admin/nav-menus.php(945): do_accordion_sections(Object(WP_Screen), 'side', NULL)\n#2 {main}\n  thrown in ../../../wp-admin/includes/nav-menu.php on line 406, referer: https://stagehqtrucks.wpengine.com/wp-admin/

I've changed the theme to a copy of the standard 2021 WP theme, disabled all of the plugins and the error persists. So it doesn't seem to be from the theme or plugin.

I also ran a high-security scan via Wordfence for anything malicious and that came back clean.

The site is on WP Engine, running PHP 8.

Downgrading PHP to 7.4 solves the issue but we are trying to upgrade.

Having trouble pinning down the error and figuring what else to look at..

1 Answer 1

0

The posts_page variable is looking for a page set as the "blog" page in the reading settings. At some point this was unset or the blog page was removed, it is not clear, but simply making a blank page and setting it as the "blog" page under settings->reading resolved the issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.