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 081c3f0)
(cherry picked from commit ac62479)
  • Loading branch information
jonasraoni committed Jun 25, 2024
1 parent 641957f commit 33c4db4
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions classes/search/MonographSearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,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['press_id'];
}

Expand Down

0 comments on commit 33c4db4

Please sign in to comment.