Loading CHANGELOG.txt +2 −0 Original line number Diff line number Diff line Search API 1.x, dev (xxxx-xx-xx): --------------------------------- - #3306204 by mkalkbrenner, drunken monkey: Added a new query option for passing non-standard language filters to the backends. - #3262092 by attilatilman, japerry, drunken monkey, Berdir: Fixed several problems regarding Drupal 10 compatibility. - #3292775 by Berdir, drunken monkey: Fixed most deprecations preventing Drupal Loading src/Plugin/views/filter/SearchApiLanguage.php +11 −5 Original line number Diff line number Diff line Loading @@ -29,16 +29,22 @@ class SearchApiLanguage extends LanguageFilter { // Only set the languages using $query->setLanguages() if the condition // would be placed directly on the query, as an AND condition. $query = $this->getQuery(); $direct_language_condition = $this->realField === 'search_api_language' && $this->operator == 'in' && $query->getGroupType($this->options['group']) && $query->getGroupOperator() == 'AND'; if ($direct_language_condition) { $op_in_required = $this->operator == 'in' && $query->getGroupType($this->options['group']) === 'AND' && $query->getGroupOperator() === 'AND'; if ($this->realField === 'search_api_language' && $op_in_required) { $query->setLanguages($this->value); } else { parent::query(); } // Also add a query option for any direct language filter including all // included languages, in case any component needs this information in // addition to the filter we placed. if ($op_in_required && $this->value) { $query->setOption('search_api_included_languages', array_values($this->value)); } } } src/Query/QueryInterface.php +4 −0 Original line number Diff line number Diff line Loading @@ -435,6 +435,10 @@ interface QueryInterface extends ConditionSetInterface { * should be returned along with the results by the backend, if possible. * For backends that support retrieving fields values, this allows them to * only retrieve the values that are actually needed. * - search_api_included_languages: A list of all languages that should be * included in the query, in case there were any restrictions. This is * mostly helpful if getLanguages() returns NULL but there might still be * just a subset of all available languages included. * However, contrib modules might introduce arbitrary other keys with their * own, special meaning. (Usually they should be prefixed with the module * name, though, to avoid conflicts.) Loading Loading
CHANGELOG.txt +2 −0 Original line number Diff line number Diff line Search API 1.x, dev (xxxx-xx-xx): --------------------------------- - #3306204 by mkalkbrenner, drunken monkey: Added a new query option for passing non-standard language filters to the backends. - #3262092 by attilatilman, japerry, drunken monkey, Berdir: Fixed several problems regarding Drupal 10 compatibility. - #3292775 by Berdir, drunken monkey: Fixed most deprecations preventing Drupal Loading
src/Plugin/views/filter/SearchApiLanguage.php +11 −5 Original line number Diff line number Diff line Loading @@ -29,16 +29,22 @@ class SearchApiLanguage extends LanguageFilter { // Only set the languages using $query->setLanguages() if the condition // would be placed directly on the query, as an AND condition. $query = $this->getQuery(); $direct_language_condition = $this->realField === 'search_api_language' && $this->operator == 'in' && $query->getGroupType($this->options['group']) && $query->getGroupOperator() == 'AND'; if ($direct_language_condition) { $op_in_required = $this->operator == 'in' && $query->getGroupType($this->options['group']) === 'AND' && $query->getGroupOperator() === 'AND'; if ($this->realField === 'search_api_language' && $op_in_required) { $query->setLanguages($this->value); } else { parent::query(); } // Also add a query option for any direct language filter including all // included languages, in case any component needs this information in // addition to the filter we placed. if ($op_in_required && $this->value) { $query->setOption('search_api_included_languages', array_values($this->value)); } } }
src/Query/QueryInterface.php +4 −0 Original line number Diff line number Diff line Loading @@ -435,6 +435,10 @@ interface QueryInterface extends ConditionSetInterface { * should be returned along with the results by the backend, if possible. * For backends that support retrieving fields values, this allows them to * only retrieve the values that are actually needed. * - search_api_included_languages: A list of all languages that should be * included in the query, in case there were any restrictions. This is * mostly helpful if getLanguages() returns NULL but there might still be * just a subset of all available languages included. * However, contrib modules might introduce arbitrary other keys with their * own, special meaning. (Usually they should be prefixed with the module * name, though, to avoid conflicts.) Loading