Page MenuHomePhabricator

Prevent users from removing task titles with "Bulk Edit"
ClosedPublic

Authored by epriestley on Mar 28 2019, 3:57 PM.
Tags
None
Referenced Files
F13162905: D20339.id48545.diff
Mon, May 6, 4:20 PM
Unknown Object (File)
Wed, May 1, 12:14 AM
Unknown Object (File)
Fri, Apr 26, 7:33 PM
Unknown Object (File)
Wed, Apr 10, 3:44 PM
Unknown Object (File)
Apr 3 2024, 9:43 PM
Unknown Object (File)
Apr 3 2024, 1:04 PM
Unknown Object (File)
Apr 1 2024, 6:46 AM
Unknown Object (File)
Mar 25 2024, 7:41 AM
Subscribers
None

Details

Summary

See downstream https://phabricator.wikimedia.org/T209449.

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

Repository
rP Phabricator
Branch
task1
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 22415
Build 30670: Run Core Tests
Build 30669: arc lint + arc unit