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
F2940261: D25669.1738046544.diff
Mon, Jan 27, 06:42
F2938403: D25669.1737994484.diff
Sun, Jan 26, 16:14
F2937409: D25669.1737958133.diff
Sun, Jan 26, 06:08
F2934731: D25669.1737800267.diff
Fri, Jan 24, 10:17
F2934419: D25669.1737787247.diff
Fri, Jan 24, 06:40
F2933873: D25669.1737781977.diff
Fri, Jan 24, 05:12
F2933526: D25669.1737773738.diff
Fri, Jan 24, 02:55
F2933513: D25669.1737773110.diff
Fri, Jan 24, 02:45

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 1298
Build 1298: 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. :)