Merge pull request #17987 from eileenmcnaughton/pseudo_mem
[civicrm-core.git] / CRM / Contact / Form / Search.php
index 38b218ab171bc3bbe4d7fed53aca11d73557563c..322dc47e317bb42c42bd06f7eca146b49ce6b204 100644 (file)
@@ -183,7 +183,7 @@ class CRM_Contact_Form_Search extends CRM_Core_Form_Search {
    */
   public static function isSearchContext($context) {
     $searchContext = CRM_Utils_Array::value($context, self::validContext());
-    return $searchContext ? TRUE : FALSE;
+    return (bool) $searchContext;
   }
 
   public static function setModeValues() {
@@ -364,10 +364,10 @@ class CRM_Contact_Form_Search extends CRM_Core_Form_Search {
     if ($this->_context !== 'amtg') {
       $taskParams['deletedContacts'] = FALSE;
       if ($this->_componentMode == CRM_Contact_BAO_Query::MODE_CONTACTS || $this->_componentMode == CRM_Contact_BAO_Query::MODE_CONTACTSRELATED) {
-        $taskParams['deletedContacts'] = CRM_Utils_Array::value('deleted_contacts', $this->_formValues);
+        $taskParams['deletedContacts'] = $this->_formValues['deleted_contacts'] ?? NULL;
       }
       $className = $this->_modeValue['taskClassName'];
-      $taskParams['ssID'] = isset($this->_ssID) ? $this->_ssID : NULL;
+      $taskParams['ssID'] = $this->_ssID ?? NULL;
       $this->_taskList += $className::permissionedTaskTitles(CRM_Core_Permission::getPermission(), $taskParams);
     }
 
@@ -398,9 +398,9 @@ class CRM_Contact_Form_Search extends CRM_Core_Form_Search {
 
     if ($this->_context === 'smog') {
       // CRM-11788, we might want to do this for all of search where force=1
-      $formQFKey = CRM_Utils_Array::value('qfKey', $this->_formValues);
-      $getQFKey = CRM_Utils_Array::value('qfKey', $_GET);
-      $postQFKey = CRM_Utils_Array::value('qfKey', $_POST);
+      $formQFKey = $this->_formValues['qfKey'] ?? NULL;
+      $getQFKey = $_GET['qfKey'] ?? NULL;
+      $postQFKey = $_POST['qfKey'] ?? NULL;
       if ($formQFKey && empty($getQFKey) && empty($postQFKey)) {
         $url = CRM_Utils_System::makeURL('qfKey') . $formQFKey;
         CRM_Utils_System::redirect($url);
@@ -481,7 +481,7 @@ class CRM_Contact_Form_Search extends CRM_Core_Form_Search {
     }
 
     $selectedContactIds = [];
-    $qfKeyParam = CRM_Utils_Array::value('qfKey', $this->_formValues);
+    $qfKeyParam = $this->_formValues['qfKey'] ?? NULL;
     // We use ajax to handle selections only if the search results component_mode is set to "contacts"
     if ($qfKeyParam && ($this->get('component_mode') <= CRM_Contact_BAO_Query::MODE_CONTACTS || $this->get('component_mode') == CRM_Contact_BAO_Query::MODE_CONTACTSRELATED)) {
       $this->addClass('crm-ajax-selection-form');