Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Minor
-
Resolution: Cannot Reproduce
-
Affects Version/s: 2.1
-
Fix Version/s: 2.2.0
-
Component/s: CiviContribute
-
Labels:None
Description
If all of a contacts recurring contributions are deleted from their record through the CiviCRM interface, then they have no visible signs of a contribution setup in their name. However, when viewing their Contact Dashboard the following fatal error occurs
-----------------------------------------
backTrace
/sites/all/modules/civicrm/CRM/Core/Error.php, backtrace, 260
/sites/all/modules/civicrm/CRM/Core/BAO/PaymentProcessor.php, fatal, 155
/sites/all/modules/civicrm/CRM/Contribute/BAO/ContributionRecur.php, getPayment, 134
/sites/all/modules/civicrm/CRM/Contribute/Page/UserDashboard.php, getPaymentProcessor, 100
/sites/all/modules/civicrm/CRM/Contribute/Page/UserDashboard.php, listContribution, 129
/sites/all/modules/civicrm/CRM/Contact/Page/View/UserDashBoard.php, run, 146
/sites/all/modules/civicrm/CRM/Contact/Page/View/UserDashBoard.php, buildUserDashBoard, 192
/sites/all/modules/civicrm/CRM/Core/Invoke.php, run, 197
/sites/all/modules/civicrm/drupal/civicrm.module, invoke, 315
, civicrm_invoke,
/includes/menu.inc, call_user_func_array, 348
/index.php, menu_execute_active_handler, 18
unrecoverable error
Sorry. A non-recoverable error has occurred.
Invalid value passed to getPayment function
Return to home page.
-----------------------------------------
I think the reason is the there is still a record in civicrm_contribution_recur for that contact, and the code in UserDashboard assumes that there is at least on contribution associated with the recurring record.
This issue could be dealt with in a number of ways, but needs a bit of thought:
a) delete the civicrm_contribution_recur table record if the last contribution associated with it is deleted
b) change code in UserDashboard to check for this case and not show contribuitons
c) change code in UserDashboard to check for this case and not show contribuitons, but do show that there is a recurring charge setup (although no actual charges completed)