Explorar o código

added current language condition to searchapi query

Bachir Soussi Chiadmi %!s(int64=6) %!d(string=hai) anos
pai
achega
d62d02201b

+ 4 - 0
sites/all/modules/figli/edlp_search/src/Controller/EdlpSearchController.php

@@ -336,6 +336,10 @@ class EdlpSearchController extends ControllerBase {
 
     // TODO: locuteurs
 
+    $language = \Drupal::languageManager()->getCurrentLanguage()->getId();
+    // $language =  \Drupal::languageManager()->getCurrentLanguage()->getName();
+    $query->addCondition('search_api_language', $language);
+
     $result = $query->execute();
     $items = $result->getResultItems();
     // dpm($items);