API exceptions not caught
Created by: sebalis
In the functions _contributionrecur_payment_processor_id
and _contributionrecur_pp_info
in contributionrecur.php
, the PHP API is used to retrieve payment processor details. These are stored in a variable that is checked for emptyness, but the API calls (to civicrm_api3
/civicrm_api
) can also throw exceptions that are not caught. This can cause problems down the line, e.g. in the CiviSEPA Dashboard that is provided by the CiviSEPA extension. This extension creates groups of outstanding recurring payments and a button to refresh this data with recurring contributions that have recently been added. The refresh button starts a task queue that will not complete if the API calls mentioned before throws an exception for any of these new contributions. The one known workaround is to disable contributionrecur for the refresh action, but this is of course cumbersome and error-prone.
In a pull request that I will submit next, I have added code to catch these exceptions, and as before FALSE is returned if the API calls are unsuccessful. I have also made sure that the value returned by _contributionrecur_pp_info
is checked before being used.
As I am aware of several instances that have this problem, could I ask for a new release once this bug is solved (perhaps using my PR)? Thanks.