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

Update transactions for handleRequest

Summary: Updates Transactions for handleRequest

Test Plan: Leave Comment, View Raw, Delete, Quote, etc.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T8628

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

+27 -54
+9 -15
src/applications/transactions/controller/PhabricatorApplicationTransactionCommentHistoryController.php
··· 3 3 final class PhabricatorApplicationTransactionCommentHistoryController 4 4 extends PhabricatorApplicationTransactionController { 5 5 6 - private $phid; 7 - 8 6 public function shouldAllowPublic() { 9 7 return true; 10 8 } 11 9 12 - public function willProcessRequest(array $data) { 13 - $this->phid = $data['phid']; 14 - } 15 - 16 - public function processRequest() { 17 - $request = $this->getRequest(); 18 - $user = $request->getUser(); 10 + public function handleRequest(AphrontRequest $request) { 11 + $viewer = $this->getViewer(); 12 + $phid = $request->getURIData('phid'); 19 13 20 14 $xaction = id(new PhabricatorObjectQuery()) 21 - ->withPHIDs(array($this->phid)) 22 - ->setViewer($user) 15 + ->withPHIDs(array($phid)) 16 + ->setViewer($viewer) 23 17 ->executeOne(); 24 18 25 19 if (!$xaction) { ··· 37 31 } 38 32 39 33 $comments = id(new PhabricatorApplicationTransactionTemplatedCommentQuery()) 40 - ->setViewer($user) 34 + ->setViewer($viewer) 41 35 ->setTemplate($xaction->getApplicationTransactionCommentObject()) 42 36 ->withTransactionPHIDs(array($xaction->getPHID())) 43 37 ->execute(); ··· 60 54 61 55 $obj_phid = $xaction->getObjectPHID(); 62 56 $obj_handle = id(new PhabricatorHandleQuery()) 63 - ->setViewer($user) 57 + ->setViewer($viewer) 64 58 ->withPHIDs(array($obj_phid)) 65 59 ->executeOne(); 66 60 67 61 $view = id(new PhabricatorApplicationTransactionView()) 68 - ->setUser($user) 62 + ->setUser($viewer) 69 63 ->setObjectPHID($obj_phid) 70 64 ->setTransactions($xactions) 71 65 ->setShowEditActions(false) 72 66 ->setHideCommentOptions(true); 73 67 74 68 $dialog = id(new AphrontDialogView()) 75 - ->setUser($user) 69 + ->setUser($viewer) 76 70 ->setWidth(AphrontDialogView::WIDTH_FULL) 77 71 ->setFlush(true) 78 72 ->setTitle(pht('Comment History'));
+4 -10
src/applications/transactions/controller/PhabricatorApplicationTransactionCommentQuoteController.php
··· 3 3 final class PhabricatorApplicationTransactionCommentQuoteController 4 4 extends PhabricatorApplicationTransactionController { 5 5 6 - private $phid; 7 - 8 - public function willProcessRequest(array $data) { 9 - $this->phid = $data['phid']; 10 - } 11 - 12 - public function processRequest() { 13 - $request = $this->getRequest(); 14 - $viewer = $request->getUser(); 6 + public function handleRequest(AphrontRequest $request) { 7 + $viewer = $this->getViewer(); 8 + $phid = $request->getURIData('phid'); 15 9 16 10 $xaction = id(new PhabricatorObjectQuery()) 17 - ->withPHIDs(array($this->phid)) 11 + ->withPHIDs(array($phid)) 18 12 ->setViewer($viewer) 19 13 ->executeOne(); 20 14 if (!$xaction) {
+8 -14
src/applications/transactions/controller/PhabricatorApplicationTransactionCommentRawController.php
··· 3 3 final class PhabricatorApplicationTransactionCommentRawController 4 4 extends PhabricatorApplicationTransactionController { 5 5 6 - private $phid; 7 - 8 - public function willProcessRequest(array $data) { 9 - $this->phid = $data['phid']; 10 - } 11 - 12 - public function processRequest() { 13 - $request = $this->getRequest(); 14 - $user = $request->getUser(); 6 + public function handleRequest(AphrontRequest $request) { 7 + $viewer = $this->getViewer(); 8 + $phid = $request->getURIData('phid'); 15 9 16 10 $xaction = id(new PhabricatorObjectQuery()) 17 - ->withPHIDs(array($this->phid)) 18 - ->setViewer($user) 11 + ->withPHIDs(array($phid)) 12 + ->setViewer($viewer) 19 13 ->executeOne(); 20 14 21 15 if (!$xaction) { ··· 34 28 35 29 $obj_phid = $xaction->getObjectPHID(); 36 30 $obj_handle = id(new PhabricatorHandleQuery()) 37 - ->setViewer($user) 31 + ->setViewer($viewer) 38 32 ->withPHIDs(array($obj_phid)) 39 33 ->executeOne(); 40 34 ··· 59 53 $addendum = PhabricatorMarkupEngine::renderOneObject( 60 54 id(new PhabricatorMarkupOneOff())->setContent($details_text), 61 55 'default', 62 - $user); 56 + $viewer); 63 57 } 64 58 } 65 59 } 66 60 } 67 61 $dialog = id(new AphrontDialogView()) 68 - ->setUser($user) 62 + ->setUser($viewer) 69 63 ->addCancelButton($obj_handle->getURI()) 70 64 ->setTitle($title); 71 65
+4 -10
src/applications/transactions/controller/PhabricatorApplicationTransactionCommentRemoveController.php
··· 3 3 final class PhabricatorApplicationTransactionCommentRemoveController 4 4 extends PhabricatorApplicationTransactionController { 5 5 6 - private $phid; 7 - 8 - public function willProcessRequest(array $data) { 9 - $this->phid = $data['phid']; 10 - } 11 - 12 - public function processRequest() { 13 - $request = $this->getRequest(); 14 - $viewer = $request->getUser(); 6 + public function handleRequest(AphrontRequest $request) { 7 + $viewer = $this->getViewer(); 8 + $phid = $request->getURIData('phid'); 15 9 16 10 $xaction = id(new PhabricatorObjectQuery()) 17 - ->withPHIDs(array($this->phid)) 11 + ->withPHIDs(array($phid)) 18 12 ->setViewer($viewer) 19 13 ->executeOne(); 20 14 if (!$xaction) {
+1 -2
src/applications/transactions/controller/PhabricatorApplicationTransactionShowOlderController.php
··· 8 8 } 9 9 10 10 public function handleRequest(AphrontRequest $request) { 11 - $request = $this->getRequest(); 12 - $viewer = $request->getUser(); 11 + $viewer = $this->getViewer(); 13 12 14 13 $object = id(new PhabricatorObjectQuery()) 15 14 ->withPHIDs(array($request->getURIData('phid')))
+1 -3
src/applications/transactions/controller/PhabricatorApplicationTransactionValueController.php
··· 8 8 } 9 9 10 10 public function handleRequest(AphrontRequest $request) { 11 - $request = $this->getRequest(); 12 - $viewer = $request->getUser(); 13 - 11 + $viewer = $this->getViewer(); 14 12 $phid = $request->getURIData('phid'); 15 13 $type = $request->getURIData('value'); 16 14