Skip to content

Commit

Permalink
Merge pull request #23027 from eileenmcnaughton/548
Browse files Browse the repository at this point in the history
dev/core#3134 Fix regression on unselected lineitem
  • Loading branch information
seamuslee001 authored Mar 25, 2022
2 parents 961bdf0 + cb74e38 commit 3420879
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions CRM/Financial/BAO/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -793,12 +793,14 @@ protected function calculateLineItems(): array {
}
else {
foreach ($this->getPriceOptions() as $fieldID => $valueID) {
$this->setPriceSetIDFromSelectedField($fieldID);
$throwAwayArray = [];
// @todo - still using getLine for now but better to bring it to this class & do a better job.
$newLines = CRM_Price_BAO_PriceSet::getLine($params, $throwAwayArray, $this->getPriceSetID(), $this->getPriceFieldSpec($fieldID), $fieldID)[1];
foreach ($newLines as $newLine) {
$lineItems[$newLine['price_field_value_id']] = $newLine;
if ($valueID !== '') {
$this->setPriceSetIDFromSelectedField($fieldID);
$throwAwayArray = [];
// @todo - still using getLine for now but better to bring it to this class & do a better job.
$newLines = CRM_Price_BAO_PriceSet::getLine($params, $throwAwayArray, $this->getPriceSetID(), $this->getPriceFieldSpec($fieldID), $fieldID)[1];
foreach ($newLines as $newLine) {
$lineItems[$newLine['price_field_value_id']] = $newLine;
}
}
}
}
Expand Down

0 comments on commit 3420879

Please sign in to comment.