diff --git a/administrator/components/com_finder/helpers/indexer/result.php b/administrator/components/com_finder/helpers/indexer/result.php index 994bbf1166a0d..462fe4b9a169f 100644 --- a/administrator/components/com_finder/helpers/indexer/result.php +++ b/administrator/components/com_finder/helpers/indexer/result.php @@ -421,7 +421,7 @@ public function addTaxonomy($branch, $title, $state = 1, $access = 1) */ public function setLanguage() { - if ($this->language == '*' || $this->language == '') + if ($this->language == '') { $this->language = $this->defaultLanguage; } diff --git a/tests/unit/suites/finderIndexer/FinderIndexerResultTest.php b/tests/unit/suites/finderIndexer/FinderIndexerResultTest.php index 48116c05e0915..678c7e6752ce9 100644 --- a/tests/unit/suites/finderIndexer/FinderIndexerResultTest.php +++ b/tests/unit/suites/finderIndexer/FinderIndexerResultTest.php @@ -217,12 +217,31 @@ public function testTaxonomy() */ public function testSetLanguage() { - // Set the language value + // Test for an empty language + $this->object->language = ''; $this->object->setLanguage(); $this->assertEquals( $this->object->language, $this->object->defaultLanguage ); + + // Test for "all" language + $this->object->language = '*'; + $this->object->setLanguage(); + + $this->assertEquals( + $this->object->language, + '*' + ); + + // Test for "it-IT" language + $this->object->language = 'it-IT'; + $this->object->setLanguage(); + + $this->assertEquals( + $this->object->language, + 'it-IT' + ); } }