Filtering by category does not show results when the category name is a number

Fixes #4789
This commit is contained in:
Frédéric Guillot
2023-03-04 13:59:27 -08:00
committed by Frédéric Guillot
parent d3694294a0
commit 18ed87cbd3
2 changed files with 108 additions and 0 deletions

View File

@@ -34,7 +34,10 @@ class TaskCategoryFilter extends BaseFilter implements FilterInterface
public function apply()
{
if (is_int($this->value) || ctype_digit((string) $this->value)) {
$this->query->beginOr();
$this->query->eq(TaskModel::TABLE.'.category_id', $this->value);
$this->query->eq(CategoryModel::TABLE.'.name', $this->value);
$this->query->closeOr();
} elseif ($this->value === 'none') {
$this->query->eq(TaskModel::TABLE.'.category_id', 0);
} else {