-
Notifications
You must be signed in to change notification settings - Fork 193
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
Refactor: migrate v2 forms to campaigns and add upgraded forms as campaign not-default forms #7645
base: epic/campaigns
Are you sure you want to change the base?
Refactor: migrate v2 forms to campaigns and add upgraded forms as campaign not-default forms #7645
Conversation
/** | ||
* Excluded upgraded V2 forms as their corresponding V3 version will be used to create the campaign - later the V2 form will be added to the proper campaign as a non-default form through the addUpgradedV2FormToCampaign() method. | ||
*/ | ||
$upgradedFormsIds = $this->getUpgradedV2FormsIds(); |
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.
Could this be refactored to a join of the meta with a "where not"? Or do we need a second query?
* | ||
* @see https://wordpress.org/documentation/article/post-status/#auto-draft | ||
*/ | ||
$query->where('forms.post_status', 'auto-draft', '!='); |
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.
I think this is conflating two different things. We do need to exclude auto-draft
as a status, but I don't think that relates in any way to a form being "upgraded" (as stated in the comment above).
@@ -19,6 +20,8 @@ final class MigrateFormsToCampaignFormsTest extends TestCase | |||
|
|||
/** | |||
* @unreleased | |||
* | |||
* @throws Exception | |||
*/ | |||
public function testCreatesParentCampaignForDonationForm() |
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.
@glaubersilva can you add a new test to cover V2 forms that are not upgraded?
Resolves GIVE-2032
Description
This PR makes the migrations of Forms to Campaigns also consider V2 forms. It also fixed a problem that was preventing forms with the upgraded status from being associated with campaigns as not-default forms in certain scenarios.
Affects
The migrations of Forms to Campaigns.
Visuals
https://www.loom.com/share/7bf0d4727f944c0da29fd0df9219d7bc?sid=2b9f341f-c61a-4f13-b088-b8600b09afab
Testing Instructions
Pre-review Checklist
@unreleased
tags included in DocBlocks