Page MenuHomePhorge

Improve error passing task IDs as URL parameter in invalid format
ClosedPublic

Authored by aklapper on May 21 2024, 16:47.
Tags
None
Referenced Files
F3328318: D25669.1743454202.diff
Sun, Mar 30, 20:50
F3321609: D25669.1743356943.diff
Sat, Mar 29, 17:49
F3318901: D25669.1743293107.diff
Sat, Mar 29, 00:05
F3318283: D25669.1743279449.diff
Fri, Mar 28, 20:17
F3318124: D25669.1743274844.diff
Fri, Mar 28, 19:00
F3318015: D25669.1743272459.diff
Fri, Mar 28, 18:20
F3313871: D25669.1743223291.diff
Fri, Mar 28, 04:41
F3309620: D25669.1743186986.diff
Thu, Mar 27, 18:36

Details

Summary

Maniphest expects the values of the ids URL parameter to be integers. Example: http://phorge.localhost/maniphest/?ids=1,2,3,4 to show a list of tasks with those IDs.
When passing monograms instead (T prefix, like T123 instead of 123), a cryptic message Expected a numeric scalar or null for %Ld conversion is shown.

Thus check if $this->taskIDs consists of integers only; if not throw a PhutilSearchQueryCompilerSyntaxException with an explanatory error message.

Closes T15838

Test Plan

Go to http://phorge.localhost/maniphest/?ids=T1,T2,T3,T4 before and after applying the patch.

Diff Detail

Repository
rP Phorge
Branch
T15838taskIdsErrorMsg (branched from master)
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 1306
Build 1306: arc lint + arc unit

Event Timeline

TODO: Check how Conduit reacts to this

Uh, Conduit also says Task IDs must be integer numbers. Nice. But how can I reset "Planned Changes"? Only by pushing another revision?

No changes; merely trying to reset "Changes planned" in Differential

avivey subscribed.

Don't we have something like phutil_is_integer method somewhere?

This revision is now accepted and ready to land.May 29 2024, 07:00

Don't we have something like phutil_is_integer method somewhere?

Nope, no luck for grep -r "_int" . | grep phutil here. :)