Avoid Postgres SQL error when using project filter with a large integer
Fixes #4845
This commit is contained in:
parent
5e4d506b28
commit
5f3225bddc
|
|
@ -33,7 +33,9 @@ class TaskProjectFilter extends BaseFilter implements FilterInterface
|
|||
*/
|
||||
public function apply()
|
||||
{
|
||||
if (is_int($this->value) || ctype_digit((string) $this->value)) {
|
||||
// Max integer value for Postgres is +2147483647
|
||||
// See https://www.postgresql.org/docs/current/datatype-numeric.html
|
||||
if (is_int($this->value) || ctype_digit((string) $this->value) && $this->value < 2147483647) {
|
||||
$this->query->eq(TaskModel::TABLE.'.project_id', $this->value);
|
||||
} else {
|
||||
$this->query->ilike(ProjectModel::TABLE.'.name', $this->value);
|
||||
|
|
|
|||
Loading…
Reference in New Issue