* 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();
}
// Check whether we found anything at all.
if (!$dao->N) {
- CRM_Core_Error::fatal($notFound);
+ throw new CRM_Core_Exception($notFound);
}
$method = 'handle' . $method;
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]));
}
}
$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';
$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),
],