Fix for membership discounts not showing in 5.62 #26538
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
Fix for membership discounts not showing in 5.62
Before
A membership configured per the screen shot automatically is applied for a renewing member in 5.61 but not 5.62
After
Functionality is returned
Technical Details
The issue is due to #24765
In 5.61 membership price sets had a value of 3 in the extends column and in 5.62 (after the upgrade is run as @kewljuice cleverly spotted) the value is no longer 3 but 3 wrapped in custom separators & hence the match is not made, the form is not identifed to the hook as a 'membership' form and civi-discount does not leap into action.
I put the change in a function ONLY called by this code patch because it is the rc but it should move to a more generic spot in the BAO_Order class in master. Also note I renamed the context function on the form as it is doing the same thing as one differently named on similar forms. The function is newly added in 5.61
Comments