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

Summary: Ref T2217. No remaining callsites. Also get rid of some methods on ManiphestTransaction that nothing calls anymore.

Test Plan: `grep`, looked at tasks.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2217

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

+1 -146
-2
src/__phutil_library_map__.php
··· 706 706 'ManiphestExcelFormat' => 'applications/maniphest/export/ManiphestExcelFormat.php', 707 707 'ManiphestExportController' => 'applications/maniphest/controller/ManiphestExportController.php', 708 708 'ManiphestHovercardEventListener' => 'applications/maniphest/event/ManiphestHovercardEventListener.php', 709 - 'ManiphestLegacyTransactionQuery' => 'applications/maniphest/query/ManiphestLegacyTransactionQuery.php', 710 709 'ManiphestNameIndex' => 'applications/maniphest/storage/ManiphestNameIndex.php', 711 710 'ManiphestNameIndexEventListener' => 'applications/maniphest/event/ManiphestNameIndexEventListener.php', 712 711 'ManiphestPHIDTypeTask' => 'applications/maniphest/phid/ManiphestPHIDTypeTask.php', ··· 2823 2822 'ManiphestTaskSearchEngine' => 'PhabricatorApplicationSearchEngine', 2824 2823 'ManiphestTaskStatus' => 'ManiphestConstants', 2825 2824 'ManiphestTaskSubscriber' => 'ManiphestDAO', 2826 - 'ManiphestTransaction' => 'PhabricatorMarkupInterface', 2827 2825 'ManiphestTransactionComment' => 'PhabricatorApplicationTransactionComment', 2828 2826 'ManiphestTransactionEditor' => 'PhabricatorEditor', 2829 2827 'ManiphestTransactionPreviewController' => 'ManiphestController',
-53
src/applications/maniphest/query/ManiphestLegacyTransactionQuery.php
··· 1 - <?php 2 - 3 - final class ManiphestLegacyTransactionQuery { 4 - 5 - public static function loadByTasks( 6 - PhabricatorUser $viewer, 7 - array $tasks) { 8 - 9 - $xactions = id(new ManiphestTransactionQuery()) 10 - ->setViewer($viewer) 11 - ->withObjectPHIDs(mpull($tasks, 'getPHID')) 12 - ->needComments(true) 13 - ->execute(); 14 - 15 - foreach ($xactions as $key => $xaction) { 16 - $xactions[$key] = ManiphestTransaction::newFromModernTransaction( 17 - $xaction); 18 - } 19 - 20 - return $xactions; 21 - } 22 - 23 - public static function loadByTask( 24 - PhabricatorUser $viewer, 25 - ManiphestTask $task) { 26 - 27 - return self::loadByTasks($viewer, array($task)); 28 - } 29 - 30 - public static function loadByTransactionID( 31 - PhabricatorUser $viewer, 32 - $xaction_id) { 33 - 34 - $xaction = id(new ManiphestTransactionPro())->load($xaction_id); 35 - if (!$xaction) { 36 - return null; 37 - } 38 - 39 - $xaction = id(new ManiphestTransactionQuery()) 40 - ->setViewer($viewer) 41 - ->withPHIDs(array($xaction->getPHID())) 42 - ->needComments(true) 43 - ->executeOne(); 44 - 45 - if ($xaction) { 46 - $xaction = ManiphestTransaction::newFromModernTransaction($xaction); 47 - } 48 - 49 - return $xaction; 50 - } 51 - 52 - 53 - }
+1 -91
src/applications/maniphest/storage/ManiphestTransaction.php
··· 1 1 <?php 2 2 3 - final class ManiphestTransaction 4 - implements PhabricatorMarkupInterface { 3 + final class ManiphestTransaction { 5 4 6 5 const MARKUP_FIELD_BODY = 'markup:body'; 7 6 ··· 14 13 15 14 public function __clone() { 16 15 $this->proxy = clone $this->proxy; 17 - } 18 - 19 - public static function newFromModernTransaction( 20 - ManiphestTransactionPro $pro) { 21 - 22 - $obj = new ManiphestTransaction(); 23 - $obj->proxy = $pro; 24 - 25 - return $obj; 26 16 } 27 17 28 18 public function getModernTransaction() { ··· 204 194 return $phids; 205 195 } 206 196 207 - public function canGroupWith($target) { 208 - if ($target->getAuthorPHID() != $this->getAuthorPHID()) { 209 - return false; 210 - } 211 - if ($target->hasComments() && $this->hasComments()) { 212 - return false; 213 - } 214 - $ttime = $target->getDateCreated(); 215 - $stime = $this->getDateCreated(); 216 - if (abs($stime - $ttime) > 60) { 217 - return false; 218 - } 219 - 220 - if ($target->getTransactionType() == $this->getTransactionType()) { 221 - $aux_type = PhabricatorTransactions::TYPE_CUSTOMFIELD; 222 - if ($this->getTransactionType() == $aux_type) { 223 - $that_key = $target->getMetadataValue('customfield:key'); 224 - $this_key = $this->getMetadataValue('customfield:key'); 225 - if ($that_key == $this_key) { 226 - return false; 227 - } 228 - } else { 229 - return false; 230 - } 231 - } 232 - 233 - return true; 234 - } 235 - 236 197 public function hasComments() { 237 198 return (bool)strlen(trim($this->getComments())); 238 - } 239 - 240 - 241 - /* -( Markup Interface )--------------------------------------------------- */ 242 - 243 - 244 - /** 245 - * @task markup 246 - */ 247 - public function getMarkupFieldKey($field) { 248 - if ($this->shouldUseMarkupCache($field)) { 249 - $id = $this->getID(); 250 - } else { 251 - $id = PhabricatorHash::digest($this->getMarkupText($field)); 252 - } 253 - return "maniphest:x:{$field}:{$id}"; 254 - } 255 - 256 - 257 - /** 258 - * @task markup 259 - */ 260 - public function getMarkupText($field) { 261 - return $this->getComments(); 262 - } 263 - 264 - 265 - /** 266 - * @task markup 267 - */ 268 - public function newMarkupEngine($field) { 269 - return PhabricatorMarkupEngine::newManiphestMarkupEngine(); 270 - } 271 - 272 - 273 - /** 274 - * @task markup 275 - */ 276 - public function didMarkupText( 277 - $field, 278 - $output, 279 - PhutilMarkupEngine $engine) { 280 - return $output; 281 - } 282 - 283 - 284 - /** 285 - * @task markup 286 - */ 287 - public function shouldUseMarkupCache($field) { 288 - return (bool)$this->getID(); 289 199 } 290 200 291 201 }