Skip to content

2026.27

@aklapper aklapper tagged this 30 Jun 11:11
Summary:
Avoid an AphrontParameterQueryException and instead throw a standard Query Error when passing task IDs as parent task IDs or subtask IDs which are not all digits.

This check already exists for `$this->taskIDs`, so perform the very same check for `$this->parentTaskIDs` and `$this->subtaskIDs`.

```
EXCEPTION: (AphrontParameterQueryException) Expected a numeric scalar or null for %Ld conversion. Query: JOIN %s e_has_parent\n          ON e_has_parent.src = task.phid\n          AND e_has_parent.type = %s\n         JOIN %s has_parent\n           ON e_has_parent.dst = has_parent.phid\n           AND has_parent.id IN (%Ld) at [<phorge>/src/infrastructure/storage/xsprintf/qsprintf.php:470]
```

Closes T16707

Test Plan:
* Go to http://phorge.localhost/maniphest/query/advanced/?parentIDs=T123,T456 or http://phorge.localhost/maniphest/query/advanced/?parentIDs=whatever
* See the additional exposed "Parent IDs" field pre-filled
* Press the "Search" button
* After this patch, get a `Query Errors - Task IDs must be integer numbers.` error displayed in the search UI, instead of a raw AphrontParameterQueryException

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T16707

Differential Revision: https://we.phorge.it/D27093
Assets 2
Loading