From 203d098b076816182a46f56530efe12176674e3e Mon Sep 17 00:00:00 2001 From: Jonas Raoni Soares da Silva Date: Tue, 25 Jun 2024 14:14:30 +0300 Subject: [PATCH 1/3] pkp/pkp-lib#10111 Replaced null by an empty string --- classes/search/MonographSearch.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/search/MonographSearch.inc.php b/classes/search/MonographSearch.inc.php index 84c6f9e52e0..4c1ccf202e3 100644 --- a/classes/search/MonographSearch.inc.php +++ b/classes/search/MonographSearch.inc.php @@ -211,7 +211,7 @@ function getKeywordsFromSearchFilters($searchFilters) { $indexFieldMap[SUBMISSION_SEARCH_INDEX_TERMS] = 'indexTerms'; $keywords = array(); if (isset($searchFilters['query'])) { - $keywords[null] = $searchFilters['query']; + $keywords[''] = $searchFilters['query']; } foreach($indexFieldMap as $bitmap => $searchField) { if (isset($searchFilters[$searchField]) && !empty($searchFilters[$searchField])) { From 081c3f0e96a4e5b2a0a1129081346844d5507901 Mon Sep 17 00:00:00 2001 From: Jonas Raoni Soares da Silva Date: Tue, 25 Jun 2024 14:15:28 +0300 Subject: [PATCH 2/3] pkp/pkp-lib#10111 Dropped the reference assignment --- classes/search/MonographSearch.inc.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/classes/search/MonographSearch.inc.php b/classes/search/MonographSearch.inc.php index 4c1ccf202e3..440af481aee 100644 --- a/classes/search/MonographSearch.inc.php +++ b/classes/search/MonographSearch.inc.php @@ -25,9 +25,8 @@ function getSparseArray($unorderedResults, $orderBy, $orderDir, $exclude) { // Calculate a well-ordered (unique) score. $resultCount = count($unorderedResults); $i = 0; - foreach ($unorderedResults as $submissionId => &$data) { - // Reference is necessary to permit modification - $data['score'] = ($resultCount * $data['count']) + $i++; + foreach ($unorderedResults as $submissionId => $data) { + $data[$submissionId]['score'] = ($resultCount * $data['count']) + $i++; } // If we got a primary sort order then apply it and use score as secondary From af22b642001391ef0a9e37d00d2a1130f272f102 Mon Sep 17 00:00:00 2001 From: Jonas Raoni Soares da Silva Date: Tue, 25 Jun 2024 14:15:36 +0300 Subject: [PATCH 3/3] pkp/pkp-lib#10111 Submodule update ##jonasraoni/bugfix-stable-3_3_0-10111-fix-search-result## --- lib/pkp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pkp b/lib/pkp index 437aff50561..08a98e710a5 160000 --- a/lib/pkp +++ b/lib/pkp @@ -1 +1 @@ -Subproject commit 437aff50561641e614d75863c57e60c976425000 +Subproject commit 08a98e710a5143d2e192a859eed6797a72d114e2