-
Notifications
You must be signed in to change notification settings - Fork 194
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
Fix: provide fallback for donation mode during model queries #7097
Conversation
@jonwaldstein Should we also have the Subscription model fallback on live mode? |
I think that would be proactively wise. Although, I would open a separate PR for that. Luckily the subscription table has a payment_mode column so adjusting the list table query (if need be) should be simpler. |
@JasonTheAdams this is ready for review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Passed manual QA tests.
ae94985
to
a6d2247
Compare
Resolves #7096 GIVE-27
Description
This resolves an issue where in some cases the donation mode was not stored in the database and the donation model query was causing an error from expecting a value. This is most notable on the admin list table. The simplest way to resolve this is to have a static fallback which was updated in this PR.
Typically we would create a migration for missing data that is expected, but this is unique in that we would have no way of knowing what the actual donation mode was at the time of creation. Furthermore, in terms of backwards compatibility - this could be a persistent issue from a third party add-on that intercepts or modifies the donation. So the safest and simplest option is just to have a static fallback value of "live" as that is always the assumption unless specifically defined as "test".
For clarity, in GiveWP 3.0+ forms, we are confident that the payment mode is always stored.
Affects
Visuals
N/A
Testing Instructions
Pre-review Checklist
@unreleased
tags included in DocBlocks