Codeinwp / wp-maintenance-mode

Adds a splash page to your site that lets visitors know your site is down for maintenance. Full access to the back- & front-end is optional.
https://wordpress.org/plugins/wp-maintenance-mode/
159 stars 82 forks source link

Call to a member function get_page_permastruct() on null #357

Closed james090500 closed 1 year ago

james090500 commented 1 year ago

Hi, When activating the maintenance page I get this issue but everything seems to activate fine.

2023/01/06 10:41:21 [error] 434#434: *601 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught Error: Call to a member function get_page_permastruct() on null in /home/james/system3/wp-includes/link-template.php:431
Stack trace:
#0 /home/james/system3/wp-includes/link-template.php(393): _get_page_link()
#1 /home/james/system3/wp-includes/link-template.php(197): get_page_link()
#2 /home/james/system3/wp-includes/nav-menu.php(850): get_permalink()
#3 [internal function]: wp_setup_nav_menu_item()
#4 /home/james/system3/wp-includes/nav-menu.php(722): array_map()
#5 /home/james/system3/wp-includes/nav-menu.php(1116): wp_get_nav_menu_items()
#6 /home/james/system3/wp-includes/class-wp-hook.php(308): _wp_auto_add_pages_to_menu()
#7 /home/james/system3/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters()
#8 /home/james/system3/wp-includes/plugin.php(517): WP_Hook->do_action()
#9 /home/james/system3/wp-includes/post.php(5347): do_action()
#10 /home/james/system3/wp-includes/post.php(4879): wp_transition_post_status()
#11 /home/james/system3/wp-content/" while reading response header from upstream, client: 172.24.224.1, server: web-dev.s3.local, request: "GET /wp-admin/options-general.php?page=wp-maintenance-mode&updated=1 HTTP/1.1", upstream: "fastcgi://unix:/run/php/php8.1-fpm.sock:", host: "web-dev.s3.local", referrer: "http://web-dev.s3.local/wp-admin/options-general.php?page=wp-maintenance-mode"
girishpanchal30 commented 1 year ago

Hey @james090500,

I can't replicate this issue with default, plugin, and WordPress Core. it seems to conflict with another plugin. Can you please share more details?

Thanks

james090500 commented 1 year ago

I have disabled all plugins except the Maintence one and this seems to still occur.

Could it be a theme issue?

girishpanchal30 commented 1 year ago

Could it be a theme issue?

maybe, You might be able to carefully switch the theme and check the issue on your local or test website.