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 9fec32e)
  • Loading branch information
jonasraoni committed Jun 25, 2024
1 parent 02a689e commit fbf7882
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions classes/search/PreprintSearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'];
}

Expand Down

0 comments on commit fbf7882

Please sign in to comment.