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

Transactions - finish making built-in transaction types implementation optional

Summary: Fixes T6403. Remaining built-ins were already built-in effectively so this is a small re-factor plus some docs. I probably wouldn't have written anything if not for the TODO so please feel free to tell me to write something else or what have you.

Test Plan: NA since this didn't actually change anything.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T6403

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

+18 -11
+18 -11
src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
··· 385 385 PhabricatorApplicationTransaction $xaction) { 386 386 387 387 switch ($xaction->getTransactionType()) { 388 - case PhabricatorTransactions::TYPE_BUILDABLE: 389 - case PhabricatorTransactions::TYPE_TOKEN: 390 - return; 391 388 case PhabricatorTransactions::TYPE_CUSTOMFIELD: 392 389 $field = $this->getCustomFieldForTransaction($object, $xaction); 393 390 return $field->applyApplicationTransactionInternalEffects($xaction); 391 + case PhabricatorTransactions::TYPE_BUILDABLE: 392 + case PhabricatorTransactions::TYPE_TOKEN: 394 393 case PhabricatorTransactions::TYPE_VIEW_POLICY: 395 394 case PhabricatorTransactions::TYPE_EDIT_POLICY: 396 395 case PhabricatorTransactions::TYPE_JOIN_POLICY: ··· 408 407 PhabricatorLiskDAO $object, 409 408 PhabricatorApplicationTransaction $xaction) { 410 409 switch ($xaction->getTransactionType()) { 411 - case PhabricatorTransactions::TYPE_BUILDABLE: 412 - case PhabricatorTransactions::TYPE_TOKEN: 413 - return; 414 410 case PhabricatorTransactions::TYPE_SUBSCRIBERS: 415 411 $subeditor = id(new PhabricatorSubscriptionsEditor()) 416 412 ->setObject($object) ··· 442 438 $field = $this->getCustomFieldForTransaction($object, $xaction); 443 439 return $field->applyApplicationTransactionExternalEffects($xaction); 444 440 case PhabricatorTransactions::TYPE_EDGE: 441 + case PhabricatorTransactions::TYPE_BUILDABLE: 442 + case PhabricatorTransactions::TYPE_TOKEN: 445 443 case PhabricatorTransactions::TYPE_VIEW_POLICY: 446 444 case PhabricatorTransactions::TYPE_EDIT_POLICY: 447 445 case PhabricatorTransactions::TYPE_JOIN_POLICY: ··· 471 469 "implementation!"); 472 470 } 473 471 474 - // TODO: Write proper documentation for these hooks. These are like the 475 - // "applyCustom" hooks, except that implementation is optional, so you do 476 - // not need to handle all of the builtin transaction types. See T6403. These 477 - // are not completely implemented. 478 - 472 + /** 473 + * @{class:PhabricatorTransactions} provides many built-in transactions 474 + * which should not require much - if any - code in specific applications. 475 + * 476 + * This method is a hook for the exceedingly-rare cases where you may need 477 + * to do **additional** work for built-in transactions. Developers should 478 + * extend this method, making sure to return the parent implementation 479 + * regardless of handling any transactions. 480 + * 481 + * See also @{method:applyBuiltinExternalTransaction}. 482 + */ 479 483 protected function applyBuiltinInternalTransaction( 480 484 PhabricatorLiskDAO $object, 481 485 PhabricatorApplicationTransaction $xaction) { ··· 493 497 } 494 498 } 495 499 500 + /** 501 + * See @{method::applyBuiltinInternalTransaction}. 502 + */ 496 503 protected function applyBuiltinExternalTransaction( 497 504 PhabricatorLiskDAO $object, 498 505 PhabricatorApplicationTransaction $xaction) {