Skip to content

Commit

Permalink
Check for "NULL" page in addPages so we don't crash when calling requ…
Browse files Browse the repository at this point in the history
…ire_once
  • Loading branch information
mattwire committed Jul 25, 2021
1 parent ae73958 commit 222ce04
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CRM/Core/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 222ce04

Please sign in to comment.