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

Add more strings for Paste title changes

Summary: See downstream: <https://phabricator.wikimedia.org/T154367>

Test Plan: {F2286968}

Reviewers: chad

Reviewed By: chad

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

+43 -11
+43 -11
src/applications/paste/xaction/PhabricatorPasteTitleTransaction.php
··· 14 14 } 15 15 16 16 public function getTitle() { 17 - return pht( 18 - '%s changed the title of this paste from %s to %s.', 19 - $this->renderAuthor(), 20 - $this->renderOldValue(), 21 - $this->renderNewValue()); 17 + $old = $this->getOldValue(); 18 + $new = $this->getNeWValue(); 19 + 20 + if (strlen($old) && strlen($new)) { 21 + return pht( 22 + '%s changed the title of this paste from %s to %s.', 23 + $this->renderAuthor(), 24 + $this->renderOldValue(), 25 + $this->renderNewValue()); 26 + } else if (strlen($new)) { 27 + return pht( 28 + '%s changed the title of this paste from untitled to %s.', 29 + $this->renderAuthor(), 30 + $this->renderNewValue()); 31 + } else { 32 + return pht( 33 + '%s changed the title of this paste from %s to untitled.', 34 + $this->renderAuthor(), 35 + $this->renderOldValue()); 36 + } 22 37 } 23 38 24 39 public function getTitleForFeed() { 25 - return pht( 26 - '%s updated the title for %s from %s to %s.', 27 - $this->renderAuthor(), 28 - $this->renderObject(), 29 - $this->renderOldValue(), 30 - $this->renderNewValue()); 40 + $old = $this->getOldValue(); 41 + $new = $this->getNeWValue(); 42 + 43 + if (strlen($old) && strlen($new)) { 44 + return pht( 45 + '%s updated the title for %s from %s to %s.', 46 + $this->renderAuthor(), 47 + $this->renderObject(), 48 + $this->renderOldValue(), 49 + $this->renderNewValue()); 50 + } else if (strlen($new)) { 51 + return pht( 52 + '%s updated the title for %s from untitled to %s.', 53 + $this->renderAuthor(), 54 + $this->renderObject(), 55 + $this->renderNewValue()); 56 + } else { 57 + return pht( 58 + '%s updated the title for %s from %s to untitled.', 59 + $this->renderAuthor(), 60 + $this->renderObject(), 61 + $this->renderOldValue()); 62 + } 31 63 } 32 64 33 65 }