Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Minor
-
Resolution: Fixed/Completed
-
Affects Version/s: 4.4.5
-
Fix Version/s: 4.5
-
Component/s: CiviContribute
-
Labels:None
Description
Attempting to cancel a recurring contribution that doesn't have any associated contributions returns a 'Required information missing" error. I have a fix, but need a second pair of eyes on it.
CRM/Contribute/Form/UpdateBilling.php, line 66 calls CRM_Contribute_BAO_ContributionRecur::getSubscriptionDetails. However, in most scenarios, the SQL in that function uses an INNER JOIN to join to civicrm_contribution - so if you have no contributions, getSubscriptionDetails returns a null object.
If you change the INNER JOIN to a LEFT JOIN[1], and select the contact_id from civicrm_contribution_recur instead of civicrm_contribution[2], this bug is fixed.
However, I'm totally unfamiliar with this area of the code and have no idea if there are situations in which this fix would fail.
If someone tells me they think this is a good fix, I can submit a PR though!
[1] CRM/Contribute/BAO/ContributionRecur.php line 388 - possibly line 405 as well?
[2] CRM/Contribute/BAO/ContributionRecur.php line 382