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

Fix an issue where transactions in mail were always rendered as text

Summary:
Fixes T12921. Currently, we call `getTitleForHTMLMail()`, but that calls `getTitleForMail()` which forces us into text rendering mode.

Instead, have `getTitleForHTML/TextMail()` force the rendering mode, then call `getTitleForMail()` with the desired rendering mode.

This causes stories like "epriestely added dependent tasks: x, y." to appear as links in email instead of plain text.

Test Plan: Used `bin/mail show-outbound --id ... --dump-html > out.html` to verify HTML mail.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T12921

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

+21 -13
+2 -2
src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
··· 3265 3265 } 3266 3266 3267 3267 if (!$is_comment || !$seen_comment) { 3268 - $header = $xaction->getTitleForMail(); 3268 + $header = $xaction->getTitleForTextMail(); 3269 3269 if ($header !== null) { 3270 3270 $headers[] = $header; 3271 3271 } ··· 3350 3350 // If this is not the first comment in the mail, add the header showing 3351 3351 // who wrote the comment immediately above the comment. 3352 3352 if (!$is_initial) { 3353 - $header = $xaction->getTitleForMail(); 3353 + $header = $xaction->getTitleForTextMail(); 3354 3354 if ($header !== null) { 3355 3355 $body->addRawPlaintextSection($header); 3356 3356 }
+19 -2
src/applications/transactions/storage/PhabricatorApplicationTransaction.php
··· 763 763 return $this->shouldHideForFeed(); 764 764 } 765 765 766 + private function getTitleForMailWithRenderingTarget($new_target) { 767 + $old_target = $this->getRenderingTarget(); 768 + try { 769 + $this->setRenderingTarget($new_target); 770 + $result = $this->getTitleForMail(); 771 + } catch (Exception $ex) { 772 + $this->setRenderingTarget($old_target); 773 + throw $ex; 774 + } 775 + $this->setRenderingTarget($old_target); 776 + return $result; 777 + } 778 + 766 779 public function getTitleForMail() { 767 - return id(clone $this)->setRenderingTarget('text')->getTitle(); 780 + return $this->getTitle(); 781 + } 782 + 783 + public function getTitleForTextMail() { 784 + return $this->getTitleForMailWithRenderingTarget(self::TARGET_TEXT); 768 785 } 769 786 770 787 public function getTitleForHTMLMail() { 771 - $title = $this->getTitleForMail(); 788 + $title = $this->getTitleForMailWithRenderingTarget(self::TARGET_HTML); 772 789 if ($title === null) { 773 790 return null; 774 791 }
-9
src/applications/transactions/storage/PhabricatorModularTransaction.php
··· 150 150 return parent::getActionStrength(); 151 151 } 152 152 153 - public function getTitleForMail() { 154 - $old_target = $this->getRenderingTarget(); 155 - $new_target = self::TARGET_TEXT; 156 - $this->setRenderingTarget($new_target); 157 - $title = $this->getTitle(); 158 - $this->setRenderingTarget($old_target); 159 - return $title; 160 - } 161 - 162 153 /* final */ public function getTitleForFeed() { 163 154 $title = $this->getTransactionImplementation()->getTitleForFeed(); 164 155 if ($title !== null) {