Merge pull request #21360 from eileenmcnaughton/case_pdf
[civicrm-core.git] / CRM / Contact / StateMachine / Search.php
index c2d7bea1f1a76f2c1a068e60a7c1339016a3a519..12cf525f85e9dfd5297706d3734d654ca7310a04 100644 (file)
@@ -41,6 +41,7 @@ class CRM_Contact_StateMachine_Search extends CRM_Core_StateMachine {
       $this->_pages['CRM_Contact_Form_Search_Builder'] = NULL;
       list($task, $result) = $this->taskName($controller, 'Builder');
     }
+    // @todo - this 'should' be removable but it's getting to this controller, for now
     elseif ($action == CRM_Core_Action::COPY) {
       $this->_pages['CRM_Contact_Form_Search_Custom'] = NULL;
       list($task, $result) = $this->taskName($controller, 'Custom');
@@ -81,7 +82,7 @@ class CRM_Contact_StateMachine_Search extends CRM_Core_StateMachine {
    */
   public function taskName($controller, $formName = 'Search') {
     // total hack, check POST vars and then session to determine stuff
-    $value = CRM_Utils_Array::value('task', $_POST);
+    $value = $_POST['task'] ?? NULL;
     if (!isset($value)) {
       $value = $this->_controller->get('task');
     }