Page MenuHomePhabricator

Prevent users from removing task titles with "Bulk Edit"

Authored by epriestley on Mar 28 2019, 3:57 PM.



See downstream

The "Bulk Edit" flow works with setContinueOnMissingFields(true), so newRequiredError() errors are ignored. This allows you to apply a transaction which changes the title to "" (the empty string) without actually hitting any errors which the workflow respects.

(Normally, setContinueOnMissingFields(...) workflows only edit properties that can't be missing, like the status of an object, so this is an unusual flow.)

Instead, validate more narrowly:

  • Transactions which would remove the title get an "invalid" error, which is respected even under "setContinueOnMissingFields()".
  • Then, we try to raise a "missing/required" error if everything otherwise looks okay.
Test Plan
  • Edited a task title normally.
  • Edited a task to remove the title (got an error).
  • Created a task with no title (disallowed: got an error).
  • Bulk edited a task to remove its title.
    • Before change: allowed.
    • After change: disallowed.

Diff Detail

rP Phabricator
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

epriestley created this revision.Mar 28 2019, 3:57 PM
epriestley requested review of this revision.Mar 28 2019, 3:58 PM
amckinley accepted this revision.Mar 28 2019, 4:02 PM
This revision is now accepted and ready to land.Mar 28 2019, 4:02 PM
This revision was automatically updated to reflect the committed changes.