From fbf78825bac7d85e65687c30cdec6f83ed80a299 Mon Sep 17 00:00:00 2001 From: Jonas Raoni Soares da Silva Date: Tue, 25 Jun 2024 15:50:05 +0300 Subject: [PATCH] pkp/pkp-lib#10111 Dropped the reference assignment (cherry picked from commit 9fec32edbf6fd53e749648bdf6d3b8d6ea6d814d) --- classes/search/PreprintSearch.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/classes/search/PreprintSearch.php b/classes/search/PreprintSearch.php index 3bd18ee5c8..ddb5090222 100644 --- a/classes/search/PreprintSearch.php +++ b/classes/search/PreprintSearch.php @@ -43,9 +43,8 @@ public function getSparseArray($unorderedResults, $orderBy, $orderDir, $exclude) $resultCount = count($unorderedResults); $i = 0; $contextIds = []; - foreach ($unorderedResults as $submissionId => &$data) { - // Reference is necessary to permit modification - $data['score'] = ($resultCount * $data['count']) + $i++; + foreach ($unorderedResults as $submissionId => $data) { + $unorderedResults[$submissionId]['score'] = ($resultCount * $data['count']) + $i++; $contextIds[] = $data['server_id']; }