@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Restrict maximum task title length to 255 characters

Summary:
A task title is supposed to summarize a task. For long novels, there is the task description.

Closes T15898

Test Plan: Go to http://phorge.localhost/maniphest/task/edit/form/default/ and enter a task title with multi-byte characters above the threshold, press "Enter".

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T15898

Differential Revision: https://we.phorge.it/D25759

+8
+8
src/applications/maniphest/xaction/ManiphestTaskTitleTransaction.php
··· 4 4 extends ManiphestTaskTransactionType { 5 5 6 6 const TRANSACTIONTYPE = 'title'; 7 + private $maximumTaskTitleLength = 255; 7 8 8 9 public function generateOldValue($object) { 9 10 return $object->getTitle(); ··· 75 76 if (!strlen($new)) { 76 77 $errors[] = $this->newInvalidError( 77 78 pht('Tasks must have a title.'), 79 + $xaction); 80 + continue; 81 + } 82 + if (mb_strlen($new) > $this->maximumTaskTitleLength) { 83 + $errors[] = $this->newInvalidError( 84 + pht('Task title cannot exceed %d characters.', 85 + $this->maximumTaskTitleLength), 78 86 $xaction); 79 87 continue; 80 88 }