From 2810dc4b461612f1bf0ece37f22a4afc234df6ab Mon Sep 17 00:00:00 2001 From: eileen Date: Mon, 19 Feb 2024 16:19:36 +1300 Subject: [PATCH] Swap assign_by_ref to assign in search templates --- CRM/Contact/Form/Search.php | 6 +++--- CRM/Core/Selector/Controller.php | 16 ++++++++-------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/CRM/Contact/Form/Search.php b/CRM/Contact/Form/Search.php index 26ea1f2cbf9c..1bdfcbac9e00 100644 --- a/CRM/Contact/Form/Search.php +++ b/CRM/Contact/Form/Search.php @@ -430,7 +430,7 @@ public function buildQuickForm() { // set the group title $groupValues = ['id' => $this->_groupID, 'title' => $this->_group[$this->_groupID]]; - $this->assign_by_ref('group', $groupValues); + $this->assign('group', $groupValues); // also set ssID if this is a saved search $ssID = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Group', $this->_groupID, 'saved_search_id'); @@ -471,7 +471,7 @@ public function buildQuickForm() { $this->setTitle(ts('Add to Group: %1', [1 => $this->_group[$this->_amtgID]])); // also set the group title and freeze the action task with Add Members to Group $groupValues = ['id' => $this->_amtgID, 'title' => $this->_group[$this->_amtgID]]; - $this->assign_by_ref('group', $groupValues); + $this->assign('group', $groupValues); $this->add('xbutton', $this->_actionButtonName, ts('Add Contacts to %1', [1 => $this->_group[$this->_amtgID]]), [ 'type' => 'submit', @@ -495,7 +495,7 @@ public function buildQuickForm() { $selectedContactIds = array_keys($selectedContactIdsArr[$qfKeyParam]); } - $this->assign_by_ref('selectedContactIds', $selectedContactIds); + $this->assign('selectedContactIds', $selectedContactIds); $rows = $this->get('rows'); diff --git a/CRM/Core/Selector/Controller.php b/CRM/Core/Selector/Controller.php index b2d899a30532..a4518b3fc70f 100644 --- a/CRM/Core/Selector/Controller.php +++ b/CRM/Core/Selector/Controller.php @@ -319,8 +319,8 @@ public function run() { } else { // assign to template and display them. - self::$_template->assign_by_ref('rows', $rows); - self::$_template->assign_by_ref('columnHeaders', $columnHeaders); + self::$_template->assign('rows', $rows); + self::$_template->assign('columnHeaders', $columnHeaders); } } else { @@ -359,11 +359,11 @@ public function run() { $this->_store->set("{$this->_prefix}summary", $summary); } else { - self::$_template->assign_by_ref("{$this->_prefix}pager", $this->_pager); - self::$_template->assign_by_ref("{$this->_prefix}sort", $this->_sort); + self::$_template->assign("{$this->_prefix}pager", $this->_pager); + self::$_template->assign("{$this->_prefix}sort", $this->_sort); - self::$_template->assign_by_ref("{$this->_prefix}columnHeaders", $finalColumnHeaders); - self::$_template->assign_by_ref("{$this->_prefix}rows", $rows); + self::$_template->assign("{$this->_prefix}columnHeaders", $finalColumnHeaders); + self::$_template->assign("{$this->_prefix}rows", $rows); self::$_template->assign("{$this->_prefix}rowsEmpty", !$rows); self::$_template->assign("{$this->_prefix}qill", $qill); self::$_template->assign("{$this->_prefix}summary", $summary); @@ -450,7 +450,7 @@ public function getSort() { * @return void */ public function moveFromSessionToTemplate() { - self::$_template->assign_by_ref("{$this->_prefix}pager", $this->_pager); + self::$_template->assign("{$this->_prefix}pager", $this->_pager); $rows = $this->_store->get("{$this->_prefix}rows"); @@ -464,7 +464,7 @@ public function moveFromSessionToTemplate() { ); } - self::$_template->assign_by_ref("{$this->_prefix}sort", $this->_sort); + self::$_template->assign("{$this->_prefix}sort", $this->_sort); $columnHeaders = (array) $this->_store->get("{$this->_prefix}columnHeaders"); foreach ($columnHeaders as $index => $columnHeader) { // Fill out the keys to avoid e-notices.