Skip to content

Commit

Permalink
Further recent regression fix
Browse files Browse the repository at this point in the history
  • Loading branch information
eileenmcnaughton committed Oct 23, 2023
1 parent 4369554 commit 1181675
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
3 changes: 0 additions & 3 deletions CRM/Contribute/Form/Contribution.php
Original file line number Diff line number Diff line change
Expand Up @@ -946,9 +946,6 @@ public function buildQuickForm() {
*/
private function buildPriceSet($form, $component = NULL, $validFieldsOnly = TRUE): void {
$priceSetId = $this->getPriceSetID();

$priceSet = CRM_Price_BAO_PriceSet::getSetDetail($priceSetId, TRUE, $validFieldsOnly);
$form->_priceSet = $priceSet[$priceSetId] ?? NULL;
$validPriceFieldIds = array_keys($form->_priceSet['fields']);

// @todo - this code is from previously shared function - can probaly go.
Expand Down
5 changes: 3 additions & 2 deletions CRM/Financial/BAO/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -683,10 +683,10 @@ protected function setPriceFieldMetadata(array $metadata): void {
if (!empty($option['membership_type_id'])) {
$membershipType = CRM_Member_BAO_MembershipType::getMembershipType((int) $option['membership_type_id']);
$metadata[$index]['options'][$optionID]['auto_renew'] = (int) $membershipType['auto_renew'];
if ($membershipType['auto_renew'] && empty($this->priceSetMetadata['auto_renew_membership_type'])) {
if ($membershipType['auto_renew'] && empty($this->priceSetMetadata['auto_renew_membership_field'])) {
// Quick form layer supports one auto-renew membership type per price set. If we
// want more for any reason we can add another array property.
$this->priceSetMetadata['auto_renew_membership_type'] = (int) $option['membership_type_id'];
$this->priceSetMetadata['auto_renew_membership_field'] = (int) $option['membership_type_id'];
}
}
}
Expand All @@ -711,6 +711,7 @@ public function getPriceSetMetadata(): array {
if (empty($this->priceSetMetadata)) {
$this->priceSetMetadata = CRM_Price_BAO_PriceSet::getCachedPriceSetDetail($this->getPriceSetID());
$this->priceSetMetadata['id'] = $this->getPriceSetID();
$this->priceSetMetadata['auto_renew_membership_field'] = NULL;
$this->setPriceFieldMetadata($this->priceSetMetadata['fields']);
unset($this->priceSetMetadata['fields']);
}
Expand Down

0 comments on commit 1181675

Please sign in to comment.