Additional fix for Joomla
authordeb.monish <monish.deb@webaccessglobal.com>
Thu, 29 Sep 2016 12:23:25 +0000 (17:53 +0530)
committerSeamus Lee <seamuslee001@gmail.com>
Sun, 9 Oct 2016 20:39:42 +0000 (07:39 +1100)
CRM/Core/Payment.php

index bb4e62a90653bc3ce0e81e8a658b3fad3a20f100..cc53caf3a738d33a6fac43ea71714ec7893b37c1 100644 (file)
@@ -1144,6 +1144,7 @@ abstract class CRM_Core_Payment {
         'processor_id' => @$_GET['processor_id'],
         'mode' => @$_GET['mode'],
         'q' => @$_GET['q'],
+        'task' => @$_GET['task'], // for Joomla
       )
     );
     CRM_Utils_System::civiExit();
@@ -1169,6 +1170,11 @@ abstract class CRM_Core_Payment {
   public static function handlePaymentMethod($method, $params = array()) {
     if (!isset($params['processor_id']) && !isset($params['processor_name'])) {
       $q = explode('/', CRM_Utils_Array::value('q', $params, ''));
+
+      if (CRM_Core_Config::singleton()->userFramework == 'Joomla' && !empty($params['task'])) {
+        $q = explode('/', CRM_Utils_Array::value('path', parse_url($params['task']), ''));
+      }
+
       $lastParam = array_pop($q);
       if (is_numeric($lastParam)) {
         $params['processor_id'] = $_GET['processor_id'] = $lastParam;