CRM-14396 - CRM_Core_Payment::handlePaymentMethod - Fix 'not found' error
authorTim Otten <totten@civicrm.org>
Fri, 11 Apr 2014 21:48:47 +0000 (14:48 -0700)
committerTim Otten <totten@civicrm.org>
Fri, 11 Apr 2014 21:48:47 +0000 (14:48 -0700)
There are two ways to locate handler class -- one via isExtensionKey() and
one via "CRM_Core_{$className}".  Prior to this patch, the error would arise
even if a class was located via "CRM_Core_{$className}".

CRM/Core/Payment.php

index c9e004ac2b8680fb2f100661c882afa899e4c3d0..6afcf6379a6327fa64650bcf88bd6ec1be8a4c25 100644 (file)
@@ -255,7 +255,6 @@ abstract class CRM_Core_Payment {
       // Check pp is extension
       $ext = CRM_Extension_System::singleton()->getMapper();
       if ($ext->isExtensionKey($dao->class_name)) {
-        $extension_instance_found = TRUE;
         $paymentClass = $ext->keyToClass($dao->class_name, 'payment');
         require_once $ext->classToPath($paymentClass);
       }
@@ -288,6 +287,7 @@ abstract class CRM_Core_Payment {
 
       // Everything, it seems, is ok - execute pp callback handler
       $processorInstance->$method();
+      $extension_instance_found = TRUE;
     }
 
     if (!$extension_instance_found) CRM_Core_Error::fatal(