viewgit/inc/functions.php:22 Function utf8_encode() is deprecated [8192]

Fix Query Editor after query rewriting changes

Chris Pollett [2023-12-18 02:Dec:th]
Fix Query Editor after query rewriting changes
Filename
src/models/PhraseModel.php
diff --git a/src/models/PhraseModel.php b/src/models/PhraseModel.php
index 2cebdb9dd..d1f99df9a 100755
--- a/src/models/PhraseModel.php
+++ b/src/models/PhraseModel.php
@@ -342,20 +342,21 @@ class PhraseModel extends ParallelModel
             if ($cache_results) {
                 list($word_structs, $format_words) = $cache_results;
             } else {
+                $original_has_disjuncts = (strpos($phrase, "|") !== false);
+                $original_phrase = $phrase;
                 if (!C\USE_CONJUNCTIVE_QUERY) {
                     $phrase = $this->rewriteAsDisjunctiveQuery(
                         $phrase, $guess_semantics);
                 }
                 $disjunct_phrases = explode("|", $phrase);
                 $can_use_query_map = $can_use_query_map &&
-                    (count($disjunct_phrases) == 1) && !empty($filter) &&
+                    !$original_has_disjuncts && !empty($filter) &&
                     $low == 0;
-                $original_has_disjuncts = (strpos($phrase, "|") !== false);
                 $query_map_results = [];
                 $query_map_urls = [];
                 if ($can_use_query_map) {
-                    $query_map = $filter->getQueryMap($disjunct_phrases[0],
-                        L\guessLocaleFromString($disjunct_phrases[0]));
+                    $query_map = $filter->getQueryMap($original_phrase,
+                        L\guessLocaleFromString($original_phrase));
                     $map_cnt = 0;
                     foreach ($query_map as $map_url) {
                         $map_parts = explode("###", $map_url);
ViewGit