Fix renew error for admins#499
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes a fatal error when an admin renews an expired recurring listing by preventing execution from falling through to $payment->get_checkout_url() when no valid payment object exists.
Changes:
- Capture and return the result of
fee_payment()during the “go to checkout” action, falling back to plan selection if no redirect occurs. - Guard the final checkout redirect to avoid calling
get_checkout_url()on a null$payment, falling back to plan selection instead.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Caution Review failedPull request was closed or merged during review WalkthroughUpdated the checkout redirection flow in the renew listing controller's dispatch method to handle missing payment objects. Instead of unconditionally calling Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 PHPStan (2.1.46)PHPStan was skipped because the user-provided config is missing the required Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
fixes https://github.com/Strategy11/business-directory-premium/issues/348
Fix fatal error when admin renews an expired recurring listing. The fee_payment() return value was silently discarded, causing execution to fall through to get_checkout_url() on a null payment object.