Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Double trigger of woocommerce_subscription_status_changed hook #629

Open
kasus opened this issue May 28, 2024 · 0 comments
Open

Double trigger of woocommerce_subscription_status_changed hook #629

kasus opened this issue May 28, 2024 · 0 comments
Labels
type: bug The issue is a confirmed bug. woocommerce-subscriptions-core

Comments

@kasus
Copy link

kasus commented May 28, 2024

Describe the bug

woocommerce_subscription_status_changed hook is double triggered when cancelling subscription.
I did some backtrace and I can tell it's caused by this commit 295cba2#diff-bb9ad31c46d815893acb9985f14b98e7573480cfee40ac203639d61063b39f86

Specifically - woocommerce_subscription_status_changed hook triggers WCS_Email_Cancelled_Subscription, which calls for subscription save function, which triggers woocommerce_subscription_status_changed again, because it's in the middle of status_transition loop, and status_transition internal variable hasn't been cleared.

@kasus kasus added the type: bug The issue is a confirmed bug. label May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug The issue is a confirmed bug. woocommerce-subscriptions-core
Projects
None yet
Development

No branches or pull requests

2 participants