Merge pull request #17719 from civicrm/5.27
[civicrm-core.git] / CRM / Contribute / Form / ContributionPage.php
index 95132b675c3bea978efbf06a2e1145c60bfe08ff..ba8bb64ec08706d24b8822fe9dc816d4af568f4b 100644 (file)
@@ -136,7 +136,7 @@ class CRM_Contribute_Form_ContributionPage extends CRM_Core_Form {
     if (CRM_Financial_BAO_FinancialType::isACLFinancialTypeStatus() && $this->_action & CRM_Core_Action::UPDATE) {
       $financialTypeID = CRM_Contribute_PseudoConstant::financialType($this->_values['financial_type_id']);
       if (!CRM_Core_Permission::check('edit contributions of type ' . $financialTypeID)) {
-        CRM_Core_Error::fatal(ts('You do not have permission to access this page.'));
+        CRM_Core_Error::statusBounce(ts('You do not have permission to access this page.'));
       }
     }
 
@@ -156,7 +156,7 @@ class CRM_Contribute_Form_ContributionPage extends CRM_Core_Form {
     $this->applyFilter('__ALL__', 'trim');
 
     $session = CRM_Core_Session::singleton();
-    $this->_cancelURL = CRM_Utils_Array::value('cancelURL', $_POST);
+    $this->_cancelURL = $_POST['cancelURL'] ?? NULL;
 
     if (!$this->_cancelURL) {
       $this->_cancelURL = CRM_Utils_System::url('civicrm/admin/contribute', 'reset=1');
@@ -289,7 +289,7 @@ class CRM_Contribute_Form_ContributionPage extends CRM_Core_Form {
         'is_pledge_start_date_editable',
       ];
       foreach ($pledgeBlock as $key) {
-        $defaults[$key] = CRM_Utils_Array::value($key, $pledgeBlockDefaults);
+        $defaults[$key] = $pledgeBlockDefaults[$key] ?? NULL;
         if ($key == 'pledge_start_date' && !empty($pledgeBlockDefaults[$key])) {
           $defaultPledgeDate = (array) json_decode($pledgeBlockDefaults['pledge_start_date']);
           $pledgeDateFields = [