From d413c86912a600b3f791c7fb5092353761fac7e7 Mon Sep 17 00:00:00 2001 From: aina-esokia Date: Mon, 26 Nov 2018 10:48:57 +0400 Subject: [PATCH] port to 4.1 search thesaurus term to all language --- .../Thesaurus/ThesaurusXmlHttpController.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/Alchemy/Phrasea/Controller/Thesaurus/ThesaurusXmlHttpController.php b/lib/Alchemy/Phrasea/Controller/Thesaurus/ThesaurusXmlHttpController.php index b5a2ff441e..ca820a6be5 100644 --- a/lib/Alchemy/Phrasea/Controller/Thesaurus/ThesaurusXmlHttpController.php +++ b/lib/Alchemy/Phrasea/Controller/Thesaurus/ThesaurusXmlHttpController.php @@ -1426,12 +1426,7 @@ class ThesaurusXmlHttpController extends Controller public function searchTermJson(Request $request) { - if (null === $lng = $request->get('lng')) { - $data = explode('_', $this->app['locale']); - if (count($data) > 0) { - $lng = $data[0]; - } - } + $lng = $request->get('lng'); $html = ''; $sbid = (int) $request->get('sbid'); @@ -1485,7 +1480,10 @@ class ThesaurusXmlHttpController extends Controller $q2 .= ' and starts-with(@k, \'' . \thesaurus::xquery_escape($unicode->remove_indexer_chars($t[1])) . '\')'; } - $q2 .= ' and @lng=\'' . \thesaurus::xquery_escape($lng) . '\''; + if($lng != null){ + $q2 .= ' and @lng=\'' . \thesaurus::xquery_escape($lng) . '\''; + } + $q .= ('//sy[' . $q2 . ']'); $nodes = $xpath->query($q);