Skip to content

Commit

Permalink
Merge pull request #27124 from civicrm/5.65
Browse files Browse the repository at this point in the history
5.65
  • Loading branch information
eileenmcnaughton authored Aug 23, 2023
2 parents 81e41d5 + 45c83bd commit 6c4985d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions CRM/Member/Form/MembershipBlock.php
Original file line number Diff line number Diff line change
Expand Up @@ -242,16 +242,16 @@ public static function formRule($params, $files, $contributionPageId = NULL) {
}
if (!empty($params['member_is_active'])) {
// Don't allow Contribution price set w/ membership signup, CRM-5095.
$priceSetExtendsMembership = \Civi\Api4\PriceSetEntity::get(FALSE)
$priceSetNotExtendingMembership = \Civi\Api4\PriceSetEntity::get(FALSE)
->addSelect('id')
->addJoin('PriceSet AS price_set', 'LEFT', ['price_set_id', '=', 'price_set.id'])
->addWhere('entity_table', '=', 'civicrm_contribution_page')
->addWhere('entity_id', '=', $contributionPageId)
->addWhere('price_set.extends:name', 'CONTAINS', 'CiviMember')
->addWhere('price_set.extends:name', 'NOT CONTAINS', 'CiviMember')
->addWhere('price_set.is_quick_config', '=', 0)
->execute()
->first();
if (!$priceSetExtendsMembership) {
if ($priceSetNotExtendingMembership) {
$errors['member_is_active'] = ts('You cannot enable both Membership Signup and a Contribution Price Set on the same online contribution page.');
return $errors;
}
Expand Down

0 comments on commit 6c4985d

Please sign in to comment.