diff --git a/CRM/Core/Controller.php b/CRM/Core/Controller.php index 0a5f6482e8d5..df2c08d38449 100644 --- a/CRM/Core/Controller.php +++ b/CRM/Core/Controller.php @@ -433,6 +433,11 @@ public function setStateMachine($stateMachine) { public function addPages(&$stateMachine, $action = CRM_Core_Action::NONE) { $pages = $stateMachine->getPages(); foreach ($pages as $name => $value) { + if (empty($name)) { + // An "empty" page can happen eg. when triggered from a StateMachine/Search class + // when there are no SearchTasks defined. + continue; + } $className = CRM_Utils_Array::value('className', $value, $name); $title = $value['title'] ?? NULL; $options = $value['options'] ?? NULL;