Page MenuHomePhabricator

Allow numeric constants to act as aliases for task priorities in the web UI <select />
ClosedPublic

Authored by epriestley on Jun 19 2017, 7:25 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Nov 17, 8:26 PM
Unknown Object (File)
Thu, Nov 14, 8:26 AM
Unknown Object (File)
Tue, Nov 12, 3:48 AM
Unknown Object (File)
Sun, Nov 10, 1:36 PM
Unknown Object (File)
Sat, Nov 9, 2:07 PM
Unknown Object (File)
Sat, Nov 9, 2:07 PM
Unknown Object (File)
Sat, Nov 9, 2:07 PM
Unknown Object (File)
Thu, Nov 7, 5:58 PM
Subscribers
None

Details

Summary

Ref T12124. This is a fairly narrow fix for existing saved EditEngine forms with a default priority value.

These saved forms have a numeric (or probably "string-numeric") default value, like "50". They lost their meaning after D18111, when "50" no longer appears in the dropdown. Instead, these forms all select the highest available priority.

At time of writing, this form was broken on this install, for example:

https://secure.phabricator.com/transactions/editengine/maniphest.task/view/13/

Additionally, /task/edit/form/123/?priority=... (for templating forms) stopped working with priority=50. This isn't nearly as important, but a larger and more sudden compatiblity break than we need to make.

Add support for an "alias map" on <select /> controls, so if the value comes in with something we don't recognize we'll treat it like some other value. Then alias all the numeric constants -- and other keywords -- to the right constants.

This ended up only affecting the <select /> control in the web UI.

Test Plan
  • On stable, created a form with "Priority: Low".
  • Before patch: form has "Priority: Unbreak Now!" on master.
  • After patch: form has "Priority: Low" again.
  • Used ?priority=25, ?priority=wish, ?priority=wishlist to template forms: all forms worked.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable