Skip to content
Snippets Groups Projects

Issue #3387673 - Fix filter

1 file
+ 11
3
Compare changes
  • Side-by-side
  • Inline
@@ -231,11 +231,19 @@ class ViewsJsonFilter extends FilterPluginBase {
* Generate the filter criteria.
*/
public function generate() {
$options = $this->options;
$operator = $this->options['operator'];
$key = $this->options['key'];
$value = !empty($this->value) && $this->isExposed() ? reset($this->value) : $this->options['value'];
if ($options['exposed'] && $options['expose']['use_operator']) {
$operator = $this->operator;
}
$value = $this->options['value'];
if ($options['exposed'] && !empty($this->value)) {
$value = $options['expose']['multiple'] ? $this->value : reset($this->value);
}
return [$key, $operator, $value];
return !empty($value) ? [$this->options['key'], $operator, $value] : [];
}
}
Loading