Unable to view contribution detail if payment processor has been disabled
This is an issue if you disable a payment processor - i.e. to replace it with another one.
Users should still be able to view contributions that are created by the disabled payment processor. Currently this isn't possible.
This is due to the following line that tries and fails to load the payment processor:
$paymentProcessor = \Civi\Payment\System::singleton()
->getById($payment['payment_processor_id']);
if ($paymentProcessor->supportsRefund()) {
// Add the refund link to the payment
$links[] = [
'name' => 'Refund Payment',
'icon' => 'fa-undo',
'url' => 'civicrm/mjwpayment/refund',
'class' => 'medium-popup',
'qs' => 'reset=1&payment_id=%%id%%&contribution_id=%%contribution_id%%',
'title' => 'Refund Payment',
];
}
Note that this doesn't appear to be an issue if the payment processor is deleted.
Edited by wmortada