Skip to content

Fix: PHP fatal error when renewing WC Subscription - #2951

Merged
shewa12 merged 4 commits into
devfrom
shewa
Aug 11, 2026
Merged

Fix: PHP fatal error when renewing WC Subscription#2951
shewa12 merged 4 commits into
devfrom
shewa

Conversation

@shewa12

@shewa12 shewa12 commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

Issue: When a WC subscription gets renewed in the background, there is no active session. With the release of v3.9.14, we have added this $order->has_status( 'checkout-draft' ) to the has_status function trigger in a filter hook; that method has code WC()->session->get(). Since the session is not available, it triggers a fatal error.

Fix: WC()->session && $order->has_status( 'checkout-draft' ). Before checking has status, a session check was added. WC always stores a session before checkout when doing it manually.

@shewa12
shewa12 requested a review from harunollyo August 10, 2026 05:19
@shewa12 shewa12 added the 4.0.5 Tutor v4.0.5 label Aug 10, 2026
@shewa12
shewa12 merged commit 826d958 into dev Aug 11, 2026
11 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4.0.5 Tutor v4.0.5

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants