Skip to content

Commit

Permalink
pkp/pkp-lib#10111 Dropped the reference assignment
Browse files Browse the repository at this point in the history
(cherry picked from commit 941db93)
(cherry picked from commit 077ba88)
  • Loading branch information
jonasraoni committed Jun 25, 2024
1 parent 754d432 commit 137fe68
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions classes/search/ArticleSearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'];
}

Expand Down

0 comments on commit 137fe68

Please sign in to comment.