-
-
Notifications
You must be signed in to change notification settings - Fork 817
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
Use APIv4 to check if a PriceSet extends CiviMember (lab.civicrm issue 4486) #27079
Conversation
Thank you for contributing to CiviCRM! ❤️ We will need to test and review the PR. 👷 Introduction for new contributors
Quick links for reviewers |
->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') |
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.
@briennekordis can you add in addWhere('price_set.is_quick_config', '=', 0)
to match the original function https://github.com/civicrm/civicrm-core/blob/master/CRM/Price/BAO/PriceSet.php#L273
…this time on the Amounts tab of the contribution page config
…this time on the Amounts tab of the contribution page config
I'm going to merge this and do a follow up PR |
[REF] Fix poor checking of extends field as per PR #27079 but this ti…
…this time on the Amounts tab of the contribution page config
->addWhere('price_set.extends:name', 'CONTAINS', 'CiviMember') | ||
->execute() | ||
->first(); | ||
if (!$priceSetExtendsMembership) { |
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.
This will be always empty when creating a new one.
@briennekordis Thanks for doing this with the API, sorry I wasn't able to come back and review before it got merged. I've fixed the regression @pradpnayak found in #27120. |
Overview
(This is a new PR derived from #27076 to be made against 5.65)
This patch resolves the issue reported on lab.civicrm regarding the inability to change membership price set on contribution pages/
Before
A user cannot switch the options for the Membership Price Set field, and instead get the follow error, despite that the Amounts tab is configured correctly:
After
A user should be able to switch the options for the Membership Price Set without error.