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

Pass recently applied transactions to HeraldAdapters

Summary: Ref T9851. See T9860. This adds a missing capability to custom HeraldActions, to pave the way for removing the obsolete/undesirable WILLEDITTASK and DIDEDITTASK events.

Test Plan: See T9860 for a replacement action.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9851

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

+37 -3
+31
src/applications/herald/adapter/HeraldAdapter.php
··· 29 29 private $contentSource; 30 30 private $isNewObject; 31 31 private $applicationEmail; 32 + private $appliedTransactions = array(); 32 33 private $queuedTransactions = array(); 33 34 private $emailPHIDs = array(); 34 35 private $forcedEmailPHIDs = array(); ··· 119 120 ->execute(); 120 121 121 122 return !empty($applications); 123 + } 124 + 125 + 126 + /** 127 + * Set the list of transactions which just took effect. 128 + * 129 + * These transactions are set by @{class:PhabricatorApplicationEditor} 130 + * automatically, before it invokes Herald. 131 + * 132 + * @param list<PhabricatorApplicationTransaction> List of transactions. 133 + * @return this 134 + */ 135 + final public function setAppliedTransactions(array $xactions) { 136 + assert_instances_of($xactions, 'PhabricatorApplicationTransaction'); 137 + $this->appliedTransactions = $xactions; 138 + return $this; 139 + } 140 + 141 + 142 + /** 143 + * Get a list of transactions which just took effect. 144 + * 145 + * When an object is edited normally, transactions are applied and then 146 + * Herald executes. You can call this method to examine the transactions 147 + * if you want to react to them. 148 + * 149 + * @return list<PhabricatorApplicationTransaction> List of transactions. 150 + */ 151 + final public function getAppliedTransactions() { 152 + return $this->appliedTransactions; 122 153 } 123 154 124 155 public function queueTransaction($transaction) {
+6 -3
src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
··· 2867 2867 PhabricatorLiskDAO $object, 2868 2868 array $xactions) { 2869 2869 2870 - $adapter = $this->buildHeraldAdapter($object, $xactions); 2871 - $adapter->setContentSource($this->getContentSource()); 2872 - $adapter->setIsNewObject($this->getIsNewObject()); 2870 + $adapter = $this->buildHeraldAdapter($object, $xactions) 2871 + ->setContentSource($this->getContentSource()) 2872 + ->setIsNewObject($this->getIsNewObject()) 2873 + ->setAppliedTransactions($xactions); 2874 + 2873 2875 if ($this->getApplicationEmail()) { 2874 2876 $adapter->setApplicationEmail($this->getApplicationEmail()); 2875 2877 } 2878 + 2876 2879 $xscript = HeraldEngine::loadAndApplyRules($adapter); 2877 2880 2878 2881 $this->setHeraldAdapter($adapter);