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

Remove ManiphestTransaction

Summary: Ref T2217. The preview had the last callsite, nuke it.

Test Plan: Used preview. Grepped for `ManiphestTransaction(`, `ManiphestTransaction::`, `'ManiphestTransaction'`, `"ManiphestTransaction"`.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2217

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

+6 -208
-1
src/__phutil_library_map__.php
··· 731 731 'ManiphestTaskSearchEngine' => 'applications/maniphest/query/ManiphestTaskSearchEngine.php', 732 732 'ManiphestTaskStatus' => 'applications/maniphest/constants/ManiphestTaskStatus.php', 733 733 'ManiphestTaskSubscriber' => 'applications/maniphest/storage/ManiphestTaskSubscriber.php', 734 - 'ManiphestTransaction' => 'applications/maniphest/storage/ManiphestTransaction.php', 735 734 'ManiphestTransactionComment' => 'applications/maniphest/storage/ManiphestTransactionComment.php', 736 735 'ManiphestTransactionEditor' => 'applications/maniphest/editor/ManiphestTransactionEditor.php', 737 736 'ManiphestTransactionEditorPro' => 'applications/maniphest/editor/ManiphestTransactionEditorPro.php',
+6 -6
src/applications/maniphest/controller/ManiphestTransactionPreviewController.php
··· 31 31 32 32 $action = $request->getStr('action'); 33 33 34 - $transaction = new ManiphestTransaction(); 34 + $transaction = new ManiphestTransactionPro(); 35 35 $transaction->setAuthorPHID($user->getPHID()); 36 36 $transaction->setTransactionType($action); 37 37 38 38 // This should really be split into a separate transaction, but it should 39 39 // all come out in the wash once we fully move to modern stuff. 40 - $transaction->getModernTransaction()->attachComment( 40 + $transaction->attachComment( 41 41 id(new ManiphestTransactionComment()) 42 42 ->setContent($comments)); 43 43 ··· 106 106 107 107 $engine = new PhabricatorMarkupEngine(); 108 108 $engine->setViewer($user); 109 - if ($transaction->getModernTransaction()->hasComment()) { 109 + if ($transaction->hasComment()) { 110 110 $engine->addObject( 111 - $transaction->getModernTransaction()->getComment(), 111 + $transaction->getComment(), 112 112 PhabricatorApplicationTransactionComment::MARKUP_FIELD_COMMENT); 113 113 } 114 114 $engine->process(); 115 115 116 - $transaction->getModernTransaction()->setHandles($handles); 116 + $transaction->setHandles($handles); 117 117 118 118 $view = id(new PhabricatorApplicationTransactionView()) 119 119 ->setUser($user) 120 - ->setTransactions(mpull($transactions, 'getModernTransaction')) 120 + ->setTransactions($transactions) 121 121 ->setIsPreview(true) 122 122 ->setIsDetailView(true); 123 123
-201
src/applications/maniphest/storage/ManiphestTransaction.php
··· 1 - <?php 2 - 3 - final class ManiphestTransaction { 4 - 5 - const MARKUP_FIELD_BODY = 'markup:body'; 6 - 7 - private $proxy; 8 - private $pendingComment; 9 - 10 - public function __construct() { 11 - $this->proxy = new ManiphestTransactionPro(); 12 - } 13 - 14 - public function __clone() { 15 - $this->proxy = clone $this->proxy; 16 - } 17 - 18 - public function getModernTransaction() { 19 - return $this->proxy; 20 - } 21 - 22 - public function save() { 23 - $this->proxy->openTransaction(); 24 - $this->proxy 25 - ->setViewPolicy('public') 26 - ->setEditPolicy($this->getAuthorPHID()) 27 - ->save(); 28 - if ($this->pendingComment) { 29 - $comment = id(new ManiphestTransactionComment()) 30 - ->setTransactionPHID($this->proxy->getPHID()) 31 - ->setCommentVersion(1) 32 - ->setAuthorPHID($this->getAuthorPHID()) 33 - ->setViewPolicy('public') 34 - ->setEditPolicy($this->getAuthorPHID()) 35 - ->setContent($this->pendingComment) 36 - ->setContentSource($this->getContentSource()) 37 - ->setIsDeleted(0) 38 - ->save(); 39 - 40 - $this->proxy 41 - ->setCommentVersion(1) 42 - ->setCommentPHID($comment->getPHID()) 43 - ->save(); 44 - 45 - $this->proxy->attachComment($comment); 46 - 47 - $this->pendingComment = null; 48 - } 49 - $this->proxy->saveTransaction(); 50 - 51 - return $this; 52 - } 53 - 54 - public function setTransactionTask(ManiphestTask $task) { 55 - $this->proxy->setObjectPHID($task->getPHID()); 56 - return $this; 57 - } 58 - 59 - public function getTaskPHID() { 60 - return $this->proxy->getObjectPHID(); 61 - } 62 - 63 - public function getID() { 64 - return $this->proxy->getID(); 65 - } 66 - 67 - public function setTaskID() { 68 - throw new Exception("No longer supported!"); 69 - } 70 - 71 - public function getTaskID() { 72 - throw new Exception("No longer supported!"); 73 - } 74 - 75 - public function getAuthorPHID() { 76 - return $this->proxy->getAuthorPHID(); 77 - } 78 - 79 - public function setAuthorPHID($phid) { 80 - $this->proxy->setAuthorPHID($phid); 81 - return $this; 82 - } 83 - 84 - public function getOldValue() { 85 - return $this->proxy->getOldValue(); 86 - } 87 - 88 - public function setOldValue($value) { 89 - $this->proxy->setOldValue($value); 90 - return $this; 91 - } 92 - 93 - public function getNewValue() { 94 - return $this->proxy->getNewValue(); 95 - } 96 - 97 - public function setNewValue($value) { 98 - $this->proxy->setNewValue($value); 99 - return $this; 100 - } 101 - 102 - public function getTransactionType() { 103 - return $this->proxy->getTransactionType(); 104 - } 105 - 106 - public function setTransactionType($value) { 107 - $this->proxy->setTransactionType($value); 108 - return $this; 109 - } 110 - 111 - public function setContentSource(PhabricatorContentSource $content_source) { 112 - $this->proxy->setContentSource($content_source); 113 - return $this; 114 - } 115 - 116 - public function getContentSource() { 117 - return $this->proxy->getContentSource(); 118 - } 119 - 120 - public function getMetadataValue($key, $default = null) { 121 - return $this->proxy->getMetadataValue($key, $default); 122 - } 123 - 124 - public function setMetadataValue($key, $value) { 125 - $this->proxy->setMetadataValue($key, $value); 126 - return $this; 127 - } 128 - 129 - public function getComments() { 130 - if ($this->pendingComment) { 131 - return $this->pendingComment; 132 - } 133 - if ($this->proxy->getComment()) { 134 - return $this->proxy->getComment()->getContent(); 135 - } 136 - return null; 137 - } 138 - 139 - public function setComments($comment) { 140 - $this->pendingComment = $comment; 141 - return $this; 142 - } 143 - 144 - public function getDateCreated() { 145 - return $this->proxy->getDateCreated(); 146 - } 147 - 148 - public function getDateModified() { 149 - return $this->proxy->getDateModified(); 150 - } 151 - 152 - public function extractPHIDs() { 153 - $phids = array(); 154 - 155 - switch ($this->getTransactionType()) { 156 - case ManiphestTransactionType::TYPE_CCS: 157 - case ManiphestTransactionType::TYPE_PROJECTS: 158 - foreach ($this->getOldValue() as $phid) { 159 - $phids[] = $phid; 160 - } 161 - foreach ($this->getNewValue() as $phid) { 162 - $phids[] = $phid; 163 - } 164 - break; 165 - case ManiphestTransactionType::TYPE_OWNER: 166 - $phids[] = $this->getOldValue(); 167 - $phids[] = $this->getNewValue(); 168 - break; 169 - case ManiphestTransactionType::TYPE_EDGE: 170 - $phids = array_merge( 171 - $phids, 172 - array_keys($this->getOldValue() + $this->getNewValue())); 173 - break; 174 - case ManiphestTransactionType::TYPE_ATTACH: 175 - $old = $this->getOldValue(); 176 - $new = $this->getNewValue(); 177 - if (!is_array($old)) { 178 - $old = array(); 179 - } 180 - if (!is_array($new)) { 181 - $new = array(); 182 - } 183 - $val = array_merge(array_values($old), array_values($new)); 184 - foreach ($val as $stuff) { 185 - foreach ($stuff as $phid => $ignored) { 186 - $phids[] = $phid; 187 - } 188 - } 189 - break; 190 - } 191 - 192 - $phids[] = $this->getAuthorPHID(); 193 - 194 - return $phids; 195 - } 196 - 197 - public function hasComments() { 198 - return (bool)strlen(trim($this->getComments())); 199 - } 200 - 201 - }