From a7352f6f06d3404555d981d92b2eaf24a4f31517 Mon Sep 17 00:00:00 2001 From: Jonas Raoni Soares da Silva Date: Tue, 25 Jun 2024 14:17:38 +0300 Subject: [PATCH 1/3] pkp/pkp-lib#10111 Replaced null by an empty string --- classes/search/ArticleSearch.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/search/ArticleSearch.inc.php b/classes/search/ArticleSearch.inc.php index 772925bb79..63dc02b3ca 100644 --- a/classes/search/ArticleSearch.inc.php +++ b/classes/search/ArticleSearch.inc.php @@ -210,7 +210,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 6e0c408c6078e505362fc54f591464ca44e3109d Mon Sep 17 00:00:00 2001 From: Jonas Raoni Soares da Silva Date: Tue, 25 Jun 2024 14:18:16 +0300 Subject: [PATCH 2/3] pkp/pkp-lib#10111 Dropped the reference assignment --- classes/search/ArticleSearch.inc.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/classes/search/ArticleSearch.inc.php b/classes/search/ArticleSearch.inc.php index 63dc02b3ca..2ec77ad55f 100644 --- a/classes/search/ArticleSearch.inc.php +++ b/classes/search/ArticleSearch.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 2890a0364ce6007af407f9da605d2cf1c73a43dc Mon Sep 17 00:00:00 2001 From: Jonas Raoni Soares da Silva Date: Tue, 25 Jun 2024 14:20:21 +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 437aff5056..1b0da6f2df 160000 --- a/lib/pkp +++ b/lib/pkp @@ -1 +1 @@ -Subproject commit 437aff50561641e614d75863c57e60c976425000 +Subproject commit 1b0da6f2df9ba6170755507857a182916e6bba0a