From 077ba88068dd4fce03d48592049724af4748d977 Mon Sep 17 00:00:00 2001 From: Jonas Raoni Soares da Silva Date: Mon, 24 Jun 2024 17:14:12 +0300 Subject: [PATCH] pkp/pkp-lib#10111 Dropped the reference assignment (cherry picked from commit 941db9399ef3b8c5396ab84ad11dfa7c19f10c2d) --- classes/search/ArticleSearch.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/classes/search/ArticleSearch.php b/classes/search/ArticleSearch.php index f073b3ac29b..6a091954d12 100644 --- a/classes/search/ArticleSearch.php +++ b/classes/search/ArticleSearch.php @@ -41,9 +41,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['journal_id']; }