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

Feature: Form inherits campaign goal #7569

Merged
merged 37 commits into from
Oct 22, 2024

Conversation

alaca
Copy link
Member

@alaca alaca commented Oct 14, 2024

Description

WIP

This PR adds functionality that sets the form goal based on the campaign goal.

Affects

Form goal

Testing Instructions

Create a new campaign
Set campaign goal
Verify that the default campaign form has the same goal settings as the campaign
Create another form and verify that the new form also has the same goal settings as the campaign.

Pre-review Checklist

  • Relevant @unreleased tags included in DocBlocks
  • Self Review of code and UX completed

@alaca alaca requested a review from glaubersilva October 14, 2024 12:36
@alaca alaca marked this pull request as draft October 14, 2024 16:05
@alaca alaca marked this pull request as ready for review October 18, 2024 10:42
@alaca alaca requested a review from kjohnson October 18, 2024 10:42
Copy link
Contributor

@glaubersilva glaubersilva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alaca I left a few comments with improvement suggestions.

Also, after pulling this branch I could see the campaign on the list table and I got the following fatal error in the logs:

[18-Oct-2024 17:46:55 UTC] PHP Fatal error:  Uncaught TypeError: Return value of Give\Campaigns\DataTransferObjects\CampaignGoalData::getPercentage() must be of the type int, float returned in C:\Users\glaub\Local Sites\givewp\app\public\wp-content\plugins\give\src\Campaigns\DataTransferObjects\CampaignGoalData.php:83
Stack trace:
#0 C:\Users\glaub\Local Sites\givewp\app\public\wp-content\plugins\give\src\Campaigns\DataTransferObjects\CampaignGoalData.php(53): Give\Campaigns\DataTransferObjects\CampaignGoalData->getPercentage()
#1 C:\Users\glaub\Local Sites\givewp\app\public\wp-content\plugins\give\src\Campaigns\ListTable\Columns\GoalColumn.php(39): Give\Campaigns\DataTransferObjects\CampaignGoalData->__construct(Object(Give\Campaigns\Models\Campaign))
#2 C:\Users\glaub\Local Sites\givewp\app\public\wp-content\plugins\give\src\Framework\ListTable\ListTable.php(135): Give\Campaigns\ListTable\Columns\GoalColumn->getCellValue(Object(Give\Campaigns\Models\Campaign), 'en-US')
#3 C:\Users\glaub\Local Sites\givewp\app\public\wp-content\plugins\give\src\Framewo in C:\Users\glaub\Local Sites\givewp\app\public\wp-content\plugins\give\src\Campaigns\DataTransferObjects\CampaignGoalData.php on line 83

image

@alaca alaca requested a review from glaubersilva October 21, 2024 13:46
Copy link
Contributor

@glaubersilva glaubersilva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@alaca alaca merged commit c9e164b into epic/campaigns Oct 22, 2024
20 checks passed
@alaca alaca deleted the feature/form-inherit-campaign-goal-GIVE-1263 branch October 22, 2024 06:31
@jonwaldstein jonwaldstein mentioned this pull request Feb 17, 2025
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants