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

Support search indexing in ApplicationTransaction

Summary: Hook D4261 into ApplicationTransaction

Test Plan: Edited a mock; searched for it.

Reviewers: btrahan, vrana

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2104

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

+23 -19
+1 -1
src/__phutil_library_map__.php
··· 1265 1265 'PholioMockQuery' => 'applications/pholio/query/PholioMockQuery.php', 1266 1266 'PholioMockViewController' => 'applications/pholio/controller/PholioMockViewController.php', 1267 1267 'PholioReplyHandler' => 'applications/pholio/mail/PholioReplyHandler.php', 1268 - 'PholioSearchIndexer' => 'applications/pholio/indexer/PholioSearchIndexer.php', 1268 + 'PholioSearchIndexer' => 'applications/pholio/search/PholioSearchIndexer.php', 1269 1269 'PholioTransaction' => 'applications/pholio/storage/PholioTransaction.php', 1270 1270 'PholioTransactionComment' => 'applications/pholio/storage/PholioTransactionComment.php', 1271 1271 'PholioTransactionQuery' => 'applications/pholio/query/PholioTransactionQuery.php',
+4 -7
src/applications/pholio/editor/PholioMockEditor.php
··· 16 16 return $types; 17 17 } 18 18 19 - protected function didApplyTransactions( 20 - PhabricatorLiskDAO $object, 21 - array $xactions) { 22 - // PholioIndexer::indexMock($mock); 23 - return; 24 - } 25 - 26 19 protected function getCustomTransactionOldValue( 27 20 PhabricatorLiskDAO $object, 28 21 PhabricatorApplicationTransaction $xaction) { ··· 126 119 } 127 120 128 121 protected function supportsFeed() { 122 + return true; 123 + } 124 + 125 + protected function supportsSearch() { 129 126 return true; 130 127 } 131 128
src/applications/pholio/indexer/PholioSearchIndexer.php src/applications/pholio/search/PholioSearchIndexer.php
+18 -11
src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
··· 1 1 <?php 2 2 3 3 /** 4 - * @task mail Sending Mail 5 - * @task feed Publishing Feed Stories 4 + * @task mail Sending Mail 5 + * @task feed Publishing Feed Stories 6 + * @task search Search Index 6 7 */ 7 8 abstract class PhabricatorApplicationTransactionEditor 8 9 extends PhabricatorEditor { ··· 193 194 return $this->contentSource; 194 195 } 195 196 196 - protected function didApplyTransactions( 197 - PhabricatorLiskDAO $object, 198 - array $xactions) { 199 - return; 200 - } 201 - 202 197 final public function applyTransactions( 203 198 PhabricatorLiskDAO $object, 204 199 array $xactions) { ··· 278 273 $mail = $this->sendMail($object, $xactions); 279 274 } 280 275 281 - // TODO: Index object. 276 + if ($this->supportsSearch()) { 277 + id(new PhabricatorSearchIndexer()) 278 + ->indexDocumentByPHID($object->getPHID()); 279 + } 282 280 283 281 if ($this->supportsFeed()) { 284 282 $mailed = array(); ··· 290 288 $xactions, 291 289 $mailed); 292 290 } 293 - 294 - $this->didApplyTransactions($object, $xactions); 295 291 296 292 return $xactions; 297 293 } ··· 875 871 ->setSubscribedPHIDs($subscribed_phids) 876 872 ->setMailRecipientPHIDs($mailed_phids) 877 873 ->publish(); 874 + } 875 + 876 + 877 + /* -( Search Index )------------------------------------------------------- */ 878 + 879 + 880 + /** 881 + * @task search 882 + */ 883 + protected function supportsSearch() { 884 + return false; 878 885 } 879 886 880 887 }