@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 Ponder for handleRequest

Summary: Update all Ponder callsites.

Test Plan: New Question, New Comment, New Answer, Vote Up and Down

Reviewers: btrahan, epriestley

Reviewed By: epriestley

Subscribers: epriestley, Korvin

Maniphest Tasks: T8628

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

+43 -99
+4 -10
src/applications/ponder/controller/PonderAnswerCommentController.php
··· 2 2 3 3 final class PonderAnswerCommentController extends PonderController { 4 4 5 - private $id; 6 - 7 - public function willProcessRequest(array $data) { 8 - $this->id = $data['id']; 9 - } 10 - 11 - public function processRequest() { 12 - $request = $this->getRequest(); 13 - $viewer = $request->getUser(); 5 + public function handleRequest(AphrontRequest $request) { 6 + $viewer = $request->getViewer(); 7 + $id = $request->getURIData('id'); 14 8 15 9 if (!$request->isFormPost()) { 16 10 return new Aphront400Response(); ··· 18 12 19 13 $answer = id(new PonderAnswerQuery()) 20 14 ->setViewer($viewer) 21 - ->withIDs(array($this->id)) 15 + ->withIDs(array($id)) 22 16 ->executeOne(); 23 17 if (!$answer) { 24 18 return new Aphront404Response();
+4 -10
src/applications/ponder/controller/PonderAnswerEditController.php
··· 2 2 3 3 final class PonderAnswerEditController extends PonderController { 4 4 5 - private $id; 6 - 7 - public function willProcessRequest(array $data) { 8 - $this->id = $data['id']; 9 - } 10 - 11 - public function processRequest() { 12 - $request = $this->getRequest(); 13 - $viewer = $request->getUser(); 5 + public function handleRequest(AphrontRequest $request) { 6 + $viewer = $request->getViewer(); 7 + $id = $request->getURIData('id'); 14 8 15 9 $answer = id(new PonderAnswerQuery()) 16 10 ->setViewer($viewer) 17 - ->withIDs(array($this->id)) 11 + ->withIDs(array($id)) 18 12 ->requireCapabilities( 19 13 array( 20 14 PhabricatorPolicyCapability::CAN_VIEW,
+4 -10
src/applications/ponder/controller/PonderAnswerHistoryController.php
··· 2 2 3 3 final class PonderAnswerHistoryController extends PonderController { 4 4 5 - private $id; 6 - 7 - public function willProcessRequest(array $data) { 8 - $this->id = $data['id']; 9 - } 10 - 11 - public function processRequest() { 12 - $request = $this->getRequest(); 13 - $viewer = $request->getUser(); 5 + public function handleRequest(AphrontRequest $request) { 6 + $viewer = $request->getViewer(); 7 + $id = $request->getURIData('id'); 14 8 15 9 $answer = id(new PonderAnswerQuery()) 16 10 ->setViewer($viewer) 17 - ->withIDs(array($this->id)) 11 + ->withIDs(array($id)) 18 12 ->executeOne(); 19 13 if (!$answer) { 20 14 return new Aphront404Response();
+2 -3
src/applications/ponder/controller/PonderAnswerSaveController.php
··· 2 2 3 3 final class PonderAnswerSaveController extends PonderController { 4 4 5 - public function processRequest() { 6 - $request = $this->getRequest(); 7 - $viewer = $request->getUser(); 5 + public function handleRequest(AphrontRequest $request) { 6 + $viewer = $request->getViewer(); 8 7 9 8 if (!$request->isFormPost()) { 10 9 return new Aphront400Response();
+4 -10
src/applications/ponder/controller/PonderQuestionCommentController.php
··· 2 2 3 3 final class PonderQuestionCommentController extends PonderController { 4 4 5 - private $id; 6 - 7 - public function willProcessRequest(array $data) { 8 - $this->id = $data['id']; 9 - } 10 - 11 - public function processRequest() { 12 - $request = $this->getRequest(); 13 - $viewer = $request->getUser(); 5 + public function handleRequest(AphrontRequest $request) { 6 + $viewer = $request->getViewer(); 7 + $id = $request->getURIData('id'); 14 8 15 9 if (!$request->isFormPost()) { 16 10 return new Aphront400Response(); ··· 18 12 19 13 $question = id(new PonderQuestionQuery()) 20 14 ->setViewer($viewer) 21 - ->withIDs(array($this->id)) 15 + ->withIDs(array($id)) 22 16 ->executeOne(); 23 17 if (!$question) { 24 18 return new Aphront404Response();
+5 -11
src/applications/ponder/controller/PonderQuestionEditController.php
··· 2 2 3 3 final class PonderQuestionEditController extends PonderController { 4 4 5 - private $id; 6 - 7 - public function willProcessRequest(array $data) { 8 - $this->id = idx($data, 'id'); 9 - } 10 - 11 - public function processRequest() { 12 - $request = $this->getRequest(); 13 - $user = $request->getUser(); 5 + public function handleRequest(AphrontRequest $request) { 6 + $user = $request->getViewer(); 7 + $id = $request->getURIData('id'); 14 8 15 - if ($this->id) { 9 + if ($id) { 16 10 $question = id(new PonderQuestionQuery()) 17 11 ->setViewer($user) 18 - ->withIDs(array($this->id)) 12 + ->withIDs(array($id)) 19 13 ->requireCapabilities( 20 14 array( 21 15 PhabricatorPolicyCapability::CAN_VIEW,
+4 -10
src/applications/ponder/controller/PonderQuestionHistoryController.php
··· 2 2 3 3 final class PonderQuestionHistoryController extends PonderController { 4 4 5 - private $id; 6 - 7 - public function willProcessRequest(array $data) { 8 - $this->id = $data['id']; 9 - } 10 - 11 - public function processRequest() { 12 - $request = $this->getRequest(); 13 - $viewer = $request->getUser(); 5 + public function handleRequest(AphrontRequest $request) { 6 + $viewer = $request->getViewer(); 7 + $id = $request->getURIData('id'); 14 8 15 9 $question = id(new PonderQuestionQuery()) 16 10 ->setViewer($viewer) 17 - ->withIDs(array($this->id)) 11 + ->withIDs(array($id)) 18 12 ->executeOne(); 19 13 if (!$question) { 20 14 return new Aphront404Response();
+3 -7
src/applications/ponder/controller/PonderQuestionListController.php
··· 2 2 3 3 final class PonderQuestionListController extends PonderController { 4 4 5 - private $queryKey; 6 - 7 5 public function shouldAllowPublic() { 8 6 return true; 9 7 } 10 8 11 - public function willProcessRequest(array $data) { 12 - $this->queryKey = idx($data, 'queryKey'); 13 - } 9 + public function handleRequest(AphrontRequest $request) { 10 + $query_key = $request->getURIData('queryKey'); 14 11 15 - public function processRequest() { 16 12 $controller = id(new PhabricatorApplicationSearchController()) 17 - ->setQueryKey($this->queryKey) 13 + ->setQueryKey($query_key) 18 14 ->setSearchEngine(new PonderQuestionSearchEngine()) 19 15 ->setNavigation($this->buildSideNavView()); 20 16
+6 -13
src/applications/ponder/controller/PonderQuestionStatusController.php
··· 3 3 final class PonderQuestionStatusController 4 4 extends PonderController { 5 5 6 - private $status; 7 - private $id; 8 - 9 - public function willProcessRequest(array $data) { 10 - $this->status = idx($data, 'status'); 11 - $this->id = idx($data, 'id'); 12 - } 13 - 14 - public function processRequest() { 15 - $request = $this->getRequest(); 16 - $viewer = $request->getUser(); 6 + public function handleRequest(AphrontRequest $request) { 7 + $viewer = $request->getViewer(); 8 + $id = $request->getURIData('id'); 9 + $status = $request->getURIData('status'); 17 10 18 11 $question = id(new PonderQuestionQuery()) 19 12 ->setViewer($viewer) 20 - ->withIDs(array($this->id)) 13 + ->withIDs(array($id)) 21 14 ->requireCapabilities( 22 15 array( 23 16 PhabricatorPolicyCapability::CAN_VIEW, ··· 28 21 return new Aphront404Response(); 29 22 } 30 23 31 - switch ($this->status) { 24 + switch ($status) { 32 25 case 'open': 33 26 $status = PonderQuestionStatus::STATUS_OPEN; 34 27 break;
+5 -12
src/applications/ponder/controller/PonderQuestionViewController.php
··· 2 2 3 3 final class PonderQuestionViewController extends PonderController { 4 4 5 - private $questionID; 6 - 7 - public function willProcessRequest(array $data) { 8 - $this->questionID = $data['id']; 9 - } 10 - 11 - public function processRequest() { 12 - 13 - $request = $this->getRequest(); 14 - $user = $request->getUser(); 5 + public function handleRequest(AphrontRequest $request) { 6 + $user = $request->getViewer(); 7 + $id = $request->getURIData('id'); 15 8 16 9 $question = id(new PonderQuestionQuery()) 17 10 ->setViewer($user) 18 - ->withIDs(array($this->questionID)) 11 + ->withIDs(array($id)) 19 12 ->needAnswers(true) 20 13 ->needViewerVotes(true) 21 14 ->executeOne(); ··· 61 54 ->addPropertyList($properties); 62 55 63 56 $crumbs = $this->buildApplicationCrumbs($this->buildSideNavView()); 64 - $crumbs->addTextCrumb('Q'.$this->questionID, '/Q'.$this->questionID); 57 + $crumbs->addTextCrumb('Q'.$id, '/Q'.$id); 65 58 66 59 return $this->buildApplicationPage( 67 60 array(
+2 -3
src/applications/ponder/controller/PonderVoteSaveController.php
··· 2 2 3 3 final class PonderVoteSaveController extends PonderController { 4 4 5 - public function processRequest() { 6 - $request = $this->getRequest(); 7 - $viewer = $request->getUser(); 5 + public function handleRequest(AphrontRequest $request) { 6 + $viewer = $request->getViewer(); 8 7 $phid = $request->getStr('phid'); 9 8 $newvote = $request->getInt('vote'); 10 9