@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.

Raise human-readable error messages for overlong Phame blog titles and subtitles

Summary:
Fixes T11358. Entering a too-long title/subtitle currently raises an unfriendly (database-level) error.

Raise a friendlier error.

Test Plan: {F1731533}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11358

Differential Revision: https://secure.phabricator.com/D16313

+27
+27
src/applications/phame/editor/PhameBlogEditor.php
··· 160 160 $error->setIsMissingFieldError(true); 161 161 $errors[] = $error; 162 162 } 163 + 164 + foreach ($xactions as $xaction) { 165 + $new = $xaction->getNewValue(); 166 + if (phutil_utf8_strlen($new) > 64) { 167 + $errors[] = new PhabricatorApplicationTransactionValidationError( 168 + $type, 169 + pht('Invalid'), 170 + pht( 171 + 'The selected blog title is too long. The maximum length '. 172 + 'of a blog title is 64 characters.'), 173 + $xaction); 174 + } 175 + } 176 + break; 177 + case PhameBlogTransaction::TYPE_SUBTITLE: 178 + foreach ($xactions as $xaction) { 179 + $new = $xaction->getNewValue(); 180 + if (phutil_utf8_strlen($new) > 64) { 181 + $errors[] = new PhabricatorApplicationTransactionValidationError( 182 + $type, 183 + pht('Invalid'), 184 + pht( 185 + 'The selected blog subtitle is too long. The maximum length '. 186 + 'of a blog subtitle is 64 characters.'), 187 + $xaction); 188 + } 189 + } 163 190 break; 164 191 case PhameBlogTransaction::TYPE_PARENTDOMAIN: 165 192 if (!$xactions) {