From 59c83184cbb77dfe0b579940d4550f1a29b8f316 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Mon, 27 Sep 2021 11:21:42 +1300 Subject: [PATCH] Fix header e-notices This should solve enotices across a bunch of screens --- CRM/Core/Selector/Controller.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/CRM/Core/Selector/Controller.php b/CRM/Core/Selector/Controller.php index 533d4042a2..66dd528f0b 100644 --- a/CRM/Core/Selector/Controller.php +++ b/CRM/Core/Selector/Controller.php @@ -461,7 +461,17 @@ class CRM_Core_Selector_Controller { } self::$_template->assign_by_ref("{$this->_prefix}sort", $this->_sort); - self::$_template->assign("{$this->_prefix}columnHeaders", $this->_store->get("{$this->_prefix}columnHeaders")); + $columnHeaders = (array) $this->_store->get("{$this->_prefix}columnHeaders"); + foreach ($columnHeaders as $index => $columnHeader) { + // Fill out the keys to avoid e-notices. + if (!isset($columnHeader['sort'])) { + $columnHeaders[$index]['sort'] = NULL; + } + if (!isset($columnHeader['name'])) { + $columnHeaders[$index]['name'] = NULL; + } + } + self::$_template->assign("{$this->_prefix}columnHeaders", $columnHeaders); self::$_template->assign("{$this->_prefix}rows", $rows); self::$_template->assign("{$this->_prefix}rowsEmpty", $this->_store->get("{$this->_prefix}rowsEmpty")); self::$_template->assign("{$this->_prefix}qill", $this->_store->get("{$this->_prefix}qill")); -- 2.25.1