Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swap assign_by_ref to assign in search templates #29433

Merged
merged 1 commit into from
Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions CRM/Contact/Form/Search.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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',
Expand All @@ -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');

Expand Down
16 changes: 8 additions & 8 deletions CRM/Core/Selector/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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");

Expand All @@ -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.
Expand Down