MAE-492: Fix membership end date after CiviCRM 5.35 update #368
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
After updating to CiviCRM 5.35, If we created a payment plan membership with pending status, we found out that the end date will increase each time we recorded a new payment.
Before
Recording a new payment will increase the membership end date.
After
Recording a new payment will not increase the membership end date.
Technical Details
This PR civicrm/civicrm-core#18410 to CiviCRM core has the following change :
Instead of creating a button with the value "Record Payment" like this
It will create a button with the value "1" like this
And the condition here will be false
The main point is to figure out if the submitted form is a record payment submission or refund submission and we can do that by checking the the variable
_paymentType
in theAdditionalPayment
Form class and prepare it forMembershipEdit
class.Comments
Another potential solution is to alter the button attributes and inject the value "Record Payment" again like this