dev/core#704 Fix loss of links for recurrings with no payment_processor_id #13935
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
Fixes 5.8 regression where the cancel link became unavailable on recurring contributions with no attached payment processor id
In 5.8 changes were made that remove the cancel links from recurring payments where the payment processor object doesn't load.
This is appropriate for cases where there IS a processor but it's disabled. However, it is not
unknown for sites to import contribution_recur records from elsewhere as data records rather than 'functional records' & it is appropriate to be able to edit those.
Before
After
Technical Details
We already have a relevant pattern - loading payment processor 0 loads the manual processor
(class is CRM_Core_Manual) which has functionality appropriate to non-automated flows
(also known as the paylater processor).
This PR switches to the function CRM_Contribute_BAO_ContributionRecur::getPaymentProcessorObject
which is a skinny wrapper on CRM_Contribute_BAO_ContributionRecur::getPaymentProcessor - which itself
was not actually called from core prior to this change (we didn't remove it as it was better than
functions in play & hence intended to start using it again). No processor is loaded
for an inactive processor so links do not appear there.
Comments