Merge pull request #13825 from mlutfy/dev801-5-12
authorEileen McNaughton <eileen@mcnaughty.com>
Fri, 15 Mar 2019 20:53:40 +0000 (09:53 +1300)
committerGitHub <noreply@github.com>
Fri, 15 Mar 2019 20:53:40 +0000 (09:53 +1300)
dev/core#801 Fix from email on PDF Letters, such as Thank You Letters.

CRM/Core/Payment.php
CRM/Core/Resources.php

index 7603137137a55ee3612bb0e9c68d725b8eb88b8c..95800b7881f191a2f875d273dba8caecd34085de 100644 (file)
@@ -1288,14 +1288,23 @@ abstract class CRM_Core_Payment {
    * Page callback for civicrm/payment/ipn
    */
   public static function handleIPN() {
-    self::handlePaymentMethod(
-      'PaymentNotification',
-      array(
-        'processor_name' => @$_GET['processor_name'],
-        'processor_id' => @$_GET['processor_id'],
-        'mode' => @$_GET['mode'],
-      )
-    );
+    try {
+      self::handlePaymentMethod(
+        'PaymentNotification',
+        [
+          'processor_name' => CRM_Utils_Request::retrieveValue('processor_name', 'String'),
+          'processor_id' => CRM_Utils_Request::retrieveValue('processor_id', 'Integer'),
+          'mode' => CRM_Utils_Request::retrieveValue('mode', 'Alphanumeric'),
+        ]
+      );
+    }
+    catch (CRM_Core_Exception $e) {
+      Civi::log()->error('ipn_payment_callback_exception', [
+        'context' => [
+          'backtrace' => CRM_Core_Error::formatBacktrace(debug_backtrace()),
+        ]
+      ]);
+    }
     CRM_Utils_System::civiExit();
   }
 
@@ -1357,7 +1366,7 @@ abstract class CRM_Core_Payment {
 
     // Check whether we found anything at all.
     if (!$dao->N) {
-      CRM_Core_Error::fatal($notFound);
+      throw new CRM_Core_Exception($notFound);
     }
 
     $method = 'handle' . $method;
@@ -1401,7 +1410,7 @@ abstract class CRM_Core_Payment {
     if (!$extension_instance_found) {
       $message = "No extension instances of the '%1' payment processor were found.<br />" .
         "%2 method is unsupported in legacy payment processors.";
-      CRM_Core_Error::fatal(ts($message, array(1 => $params['processor_name'], 2 => $method)));
+      throw new CRM_Core_Exception(ts($message, [1 => $params['processor_name'], 2 => $method]));
     }
   }
 
index 3c9ecf006e9e6e2afa5acb219b135a32c0d1de16..0e4e7755ece0e2f7178a800df2d152a4ac2673b0 100644 (file)
@@ -750,9 +750,17 @@ class CRM_Core_Resources {
     $contactID = CRM_Core_Session::getLoggedInContactID();
 
     // Menubar
-    $position = $contactID && CRM_Core_Permission::check('access CiviCRM') ? Civi::settings()->get('menubar_position') : 'none';
-    if ($position !== 'none' && !@constant('CIVICRM_DISABLE_DEFAULT_MENU') && !CRM_Core_Config::isUpgradeMode()) {
-      $cms = strtolower(CRM_Core_Config::singleton()->userFramework);
+    $position = 'none';
+    if (
+      $contactID && !$config->userFrameworkFrontend
+      && CRM_Core_Permission::check('access CiviCRM')
+      && !@constant('CIVICRM_DISABLE_DEFAULT_MENU')
+      && !CRM_Core_Config::isUpgradeMode()
+    ) {
+      $position = Civi::settings()->get('menubar_position') ?: 'over-cms-menu';
+    }
+    if ($position !== 'none') {
+      $cms = strtolower($config->userFramework);
       $cms = $cms === 'drupal' ? 'drupal7' : $cms;
       $items[] = 'bower_components/smartmenus/dist/jquery.smartmenus.min.js';
       $items[] = 'bower_components/smartmenus/dist/addons/keyboard/jquery.smartmenus.keyboard.min.js';
@@ -762,7 +770,7 @@ class CRM_Core_Resources {
       $items[] = "css/menubar-$cms.css";
       $items[] = [
         'menubar' => [
-          'position' => $position ?: 'over-cms-menu',
+          'position' => $position,
           'qfKey' => CRM_Core_Key::get('CRM_Contact_Controller_Search', TRUE),
           'cacheCode' => CRM_Core_BAO_Navigation::getCacheKey($contactID),
         ],