Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • smousionis Friend
    #179132

    Hello. I want to ask something. There is a select option “ANY”. I created three different modules (Greek, English, Russian). Every module has 3 extra fields with drop-down selection. If i set the value to “ANY”, in the search results i get results from every three languages. If i select ranged values from every field i get the right results for the right language. So the select option “ANY” is giving results for all K2 items that i created, no matter the language and the field group is registered. In the “jak2_filter.php” in line 660 there is:
    $objects[] = JHTML::_(‘select.option’, “”, JText::_(‘JAK2_FILTER_ANY’) . ” ” . $item->name);

    Can this line or something else be altered to read the language or something else so that it gives back search results only for the language that the module is created, and not for all languages? Thanks.

    MoonSailor Friend
    #461239

    Hi smousionis,

    When you search with case “Any”, it ignore fields in search value. So, it search all items of category associated extrafields config.

    In the case, file “jak2_filter.php”, find line 339:
    [PHP]if (count($sql) > 0) {
    $query .= “WHERE ” . implode(” AND “, $sql);
    }[/PHP]
    add after it

    [PHP]$mainframe = JFactory::getApplication();
    if (K2_JVERSION == ’16’ && $mainframe->isSite() && $mainframe->getLanguageFilter())
    {
    $languageTag = JFactory::getLanguage()->getTag();
    $query .= ” AND c.language IN (“.$db->Quote($languageTag).”, “.$db->Quote(‘*’).”) AND i.language IN (“.$db->Quote($languageTag).”, “.$db->Quote(‘*’).”) “;
    }[/PHP]

    Thanks.

Viewing 2 posts - 1 through 2 (of 2 total)

This topic contains 2 replies, has 2 voices, and was last updated by  MoonSailor 12 years, 4 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum