From 619756b8cb0311be13d193c07e64c8183f4ad037 Mon Sep 17 00:00:00 2001 From: Matthew Wire Date: Fri, 23 Jul 2021 23:51:08 +0100 Subject: [PATCH] Check for no action task so we don't add an undefined page --- CRM/Contact/StateMachine/Search.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/CRM/Contact/StateMachine/Search.php b/CRM/Contact/StateMachine/Search.php index 83c60dea7d97..376e8b5246a7 100644 --- a/CRM/Contact/StateMachine/Search.php +++ b/CRM/Contact/StateMachine/Search.php @@ -50,13 +50,15 @@ public function __construct($controller, $action = CRM_Core_Action::NONE) { list($task, $result) = $this->taskName($controller, 'Basic'); } $this->_task = $task; - if (is_array($task)) { - foreach ($task as $t) { - $this->_pages[$t] = NULL; + if (isset($task)) { + if (is_array($task)) { + foreach ($task as $t) { + $this->_pages[$t] = NULL; + } + } + else { + $this->_pages[$task] = NULL; } - } - else { - $this->_pages[$task] = NULL; } if ($result) {