-
-
Notifications
You must be signed in to change notification settings - Fork 824
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
Fixes getTemplateContribution to use a more reliable way to load line items #20784
Conversation
(Standard links)
|
Hmm - some of those failing tests have been marked as 'invalid financials' - I suspect the failures are issues with the tests - but I will work through |
@eileenmcnaughton the test failures seems to be related:
|
76f9166
to
509229c
Compare
@@ -179,7 +201,7 @@ public function _unserialize(array $data): void { | |||
public function getOverrideTotalAmount() { | |||
// The override amount is only valid for quick config price sets where more | |||
// than one field has not been selected. | |||
if (!$this->overrideTotalAmount || !$this->supportsOverrideAmount() || count($this->getPriceOptions()) > 1) { |
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.
ditching the supportsOverrideAmount because
- it creates order issues - the prices set needs to be determined before it can be accessed and
- it just came out of logic moved from a form - but really I don't think there is any real reason at a BAO level why only quickconfig can support amount overrides. Quick config was always envisaged as a form presentation issue but the implementation got greedy. I think it's a form layer issue
10ad7ea
to
95f8f44
Compare
… items My efforts to add testing a 'deprecate weird stuff' have identified an odd and fragile flow for the line items in getTemplateContribution. It calls getLineItemsByContributionID which, as it turns out, substitues the actual entity table with 'civicrm_contribution'. Then this line of weird handling swoops in and saves the day. https://github.com/civicrm/civicrm-core/pull/20775/files#diff-a16d4d7449cf5f3a0616d1d282a32f27ab6d3f7d2726d076c02ad1d4d655af41R393 This switches us to something cleaner than just loads the line items (with v4 LineItem.get) and no weird handling
95f8f44
to
4df23f2
Compare
test this please |
@monishdeb I finally got this to pass - note #20775 is just this plus a deprecation warning in the code this allows us to not call |
Looks good and mergeable based on:
|
Overview
Fixes getTemplateContribution to use a more reliable way to load line items
My efforts to add testing a 'deprecate weird stuff' have identified an odd and fragile
flow for the line items in getTemplateContribution. It calls
getLineItemsByContributionID which, as it turns out, substitues the
actual entity table with 'civicrm_contribution'.
Then this line of weird handling swoops in and saves the day.
This PR switches us to something cleaner than just loads the line items (with v4 LineItem.get) and
no weird handling
Before
Line items loaded in correctly & then fixed later
After
Line items loaded correctly
Technical Details
This relies on a couple of fixes that I'll rebase out of the PR once merged #20079 and on top of that #20780
Comments