Merge pull request #17147 from kartik1000/Fix#1650
[civicrm-core.git] / CRM / Friend / Form.php
index ce38a42d3fa5a2bb1474b1e366f2afaa4245ad4b..2af78a571a9ace8e35870c9dbeec110bf46b0f9f 100644 (file)
@@ -73,8 +73,8 @@ class CRM_Friend_Form extends CRM_Core_Form {
       CRM_Core_DAO::commonRetrieve('CRM_Contribute_DAO_ContributionPage',
         $params, $values, ['title', 'campaign_id', 'is_share']
       );
-      $this->_title = CRM_Utils_Array::value('title', $values);
-      $this->_campaignId = CRM_Utils_Array::value('campaign_id', $values);
+      $this->_title = $values['title'] ?? NULL;
+      $this->_campaignId = $values['campaign_id'] ?? NULL;
       $this->_entityTable = 'civicrm_contribution_page';
       if ($pcomponent == 'event') {
         $this->_entityTable = 'civicrm_event';
@@ -82,7 +82,7 @@ class CRM_Friend_Form extends CRM_Core_Form {
         $this->_title = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Event', $this->_entityId, 'title');
       }
       else {
-        $isShare = CRM_Utils_Array::value('is_share', $values);
+        $isShare = $values['is_share'] ?? NULL;
       }
       // Tell Form.tpl whether to include SocialNetwork.tpl for social media sharing
       $this->assign('isShare', $isShare);
@@ -97,7 +97,7 @@ class CRM_Friend_Form extends CRM_Core_Form {
       );
 
       if (empty($values['is_tellfriend_enabled'])) {
-        CRM_Core_Error::fatal(ts('Tell Friend is disable for this Personal Campaign Page'));
+        CRM_Core_Error::statusBounce(ts('Tell Friend is disable for this Personal Campaign Page'));
       }
 
       $this->_mailLimit = $values['tellfriend_limit'];
@@ -118,7 +118,7 @@ class CRM_Friend_Form extends CRM_Core_Form {
       $this->assign('pcpTitle', $this->_title);
     }
     else {
-      CRM_Core_Error::fatal(ts('page argument missing or invalid'));
+      CRM_Core_Error::statusBounce(ts('page argument missing or invalid'));
     }
     $this->assign('context', $pcomponent);