Subscription post `post_status` cannot be `null`
Closed this issue · 1 comments
remcotolsma commented
We just encountered the following error message with WP Rocket:
[25-Oct-2023 13:01:01 UTC] PHP Fatal error: Uncaught TypeError: Argument 1 passed to WP_Rocket\Engine\Preload\Subscriber::remove_private_post() must be of the type string, null given, called in /home/customer/www/example.com/public_html/wp-includes/class-wp-hook.php on line 310 and defined in /home/customer/www/example.com/public_html/wp-content/plugins/wp-rocket/inc/Engine/Preload/Subscriber.php:467
Stack trace:
#0 /home/customer/www/example.com/public_html/wp-includes/class-wp-hook.php(310): WP_Rocket\Engine\Preload\Subscriber->remove_private_post(NULL, 'subscr_pending', Object(WP_Post))
#1 /home/customer/www/example.com/public_html/wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters(false, Array)
#2 /home/customer/www/example.com/public_html/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#3 /home/customer/www/example.com/public_html/wp-includes/post.php(5383): do_action('transition_post...', NULL, 'subscr_pending', Object(WP_Post))
#4 /home/customer/www/example.com/public_html/wp-includes/post.php(4643): wp_transition_post_status(NULL, 'subscr_pend in /home/customer/www/example.com/public_html/wp-content/plugins/wp-rocket/inc/Engine/Preload/Subscriber.php on line 467
Internal HelpScout ticket: https://secure.helpscout.net/conversation/2357245448/26133?folderId=1425710
After some research, this could be caused by this library:
wp-pay-core/src/Subscriptions/SubscriptionsDataStoreCPT.php
Lines 182 to 184 in 68e9473
wp-pay-core/src/Subscriptions/SubscriptionsDataStoreCPT.php
Lines 119 to 135 in 68e9473
remcotolsma commented
The changes in #159 seem to have solved the problem, see also the internal HelpScout ticket: https://secure.helpscout.net/conversation/2357245448/26133/.