Page MenuHomePhabricator

D20339.id48544.diff
No OneTemporary

D20339.id48544.diff

diff --git a/src/applications/maniphest/xaction/ManiphestTaskTitleTransaction.php b/src/applications/maniphest/xaction/ManiphestTaskTitleTransaction.php
--- a/src/applications/maniphest/xaction/ManiphestTaskTitleTransaction.php
+++ b/src/applications/maniphest/xaction/ManiphestTaskTitleTransaction.php
@@ -64,9 +64,27 @@
public function validateTransactions($object, array $xactions) {
$errors = array();
- if ($this->isEmptyTextTransaction($object->getTitle(), $xactions)) {
- $errors[] = $this->newRequiredError(
- pht('Tasks must have a title.'));
+ // If the user is acting via "Bulk Edit" or another workflow which
+ // continues on missing fields, they may be applying a transaction which
+ // removes the task title. Mark these transactions as invalid first,
+ // then flag the missing field error if we don't find any more specific
+ // problems.
+
+ foreach ($xactions as $xaction) {
+ $new = $xaction->getNewValue();
+ if (!strlen($new)) {
+ $errors[] = $this->newInvalidError(
+ pht('Tasks must have a title.'),
+ $xaction);
+ continue;
+ }
+ }
+
+ if (!$errors) {
+ if ($this->isEmptyTextTransaction($object->getTitle(), $xactions)) {
+ $errors[] = $this->newRequiredError(
+ pht('Tasks must have a title.'));
+ }
}
return $errors;

File Metadata

Mime Type
text/plain
Expires
Mon, Feb 24, 10:08 AM (10 h, 43 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7187983
Default Alt Text
D20339.id48544.diff (1 KB)

Event Timeline