Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15459790
D13771.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D13771.id.diff
View Options
diff --git a/src/applications/audit/controller/PhabricatorAuditAddCommentController.php b/src/applications/audit/controller/PhabricatorAuditAddCommentController.php
--- a/src/applications/audit/controller/PhabricatorAuditAddCommentController.php
+++ b/src/applications/audit/controller/PhabricatorAuditAddCommentController.php
@@ -3,9 +3,8 @@
final class PhabricatorAuditAddCommentController
extends PhabricatorAuditController {
- public function processRequest() {
- $request = $this->getRequest();
- $user = $request->getUser();
+ public function handleRequest(AphrontRequest $request) {
+ $viewer = $request->getViewer();
if (!$request->isFormPost()) {
return new Aphront403Response();
@@ -13,7 +12,7 @@
$commit_phid = $request->getStr('commit');
$commit = id(new DiffusionCommitQuery())
- ->setViewer($user)
+ ->setViewer($viewer)
->withPHIDs(array($commit_phid))
->needAuditRequests(true)
->executeOne();
@@ -61,7 +60,7 @@
}
$inlines = PhabricatorAuditInlineComment::loadDraftComments(
- $user,
+ $viewer,
$commit->getPHID());
foreach ($inlines as $inline) {
$xactions[] = id(new PhabricatorAuditTransaction())
@@ -70,14 +69,14 @@
}
id(new PhabricatorAuditEditor())
- ->setActor($user)
+ ->setActor($viewer)
->setContentSourceFromRequest($request)
->setContinueOnMissingFields(true)
->applyTransactions($commit, $xactions);
$draft = id(new PhabricatorDraft())->loadOneWhere(
'authorPHID = %s AND draftKey = %s',
- $user->getPHID(),
+ $viewer->getPHID(),
'diffusion-audit-'.$commit->getID());
if ($draft) {
$draft->delete();
diff --git a/src/applications/audit/controller/PhabricatorAuditPreviewController.php b/src/applications/audit/controller/PhabricatorAuditPreviewController.php
--- a/src/applications/audit/controller/PhabricatorAuditPreviewController.php
+++ b/src/applications/audit/controller/PhabricatorAuditPreviewController.php
@@ -3,17 +3,11 @@
final class PhabricatorAuditPreviewController
extends PhabricatorAuditController {
- private $id;
+ public function handleRequest(AphrontRequest $request) {
+ $viewer = $request->getViewer();
+ $id = $request->getURIData('id');
- public function willProcessRequest(array $data) {
- $this->id = $data['id'];
- }
-
- public function processRequest() {
- $request = $this->getRequest();
- $user = $request->getUser();
-
- $commit = id(new PhabricatorRepositoryCommit())->load($this->id);
+ $commit = id(new PhabricatorRepositoryCommit())->load($id);
if (!$commit) {
return new Aphront404Response();
}
@@ -23,7 +17,7 @@
$action = $request->getStr('action');
if ($action != PhabricatorAuditActionConstants::COMMENT) {
$action_xaction = id(new PhabricatorAuditTransaction())
- ->setAuthorPHID($user->getPHID())
+ ->setAuthorPHID($viewer->getPHID())
->setObjectPHID($commit->getPHID())
->setTransactionType(PhabricatorAuditActionConstants::ACTION)
->setNewValue($action);
@@ -52,7 +46,7 @@
$content = $request->getStr('content');
if (strlen($content)) {
$xactions[] = id(new PhabricatorAuditTransaction())
- ->setAuthorPHID($user->getPHID())
+ ->setAuthorPHID($viewer->getPHID())
->setObjectPHID($commit->getPHID())
->setTransactionType(PhabricatorTransactions::TYPE_COMMENT)
->attachComment(
@@ -72,13 +66,13 @@
$view = id(new PhabricatorAuditTransactionView())
->setIsPreview(true)
- ->setUser($user)
+ ->setUser($viewer)
->setObjectPHID($commit->getPHID())
->setTransactions($xactions);
id(new PhabricatorDraft())
- ->setAuthorPHID($user->getPHID())
- ->setDraftKey('diffusion-audit-'.$this->id)
+ ->setAuthorPHID($viewer->getPHID())
+ ->setDraftKey('diffusion-audit-'.$id)
->setDraft($content)
->replaceOrDelete();
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Apr 1, 4:14 PM (3 d, 15 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7718254
Default Alt Text
D13771.id.diff (3 KB)
Attached To
Mode
D13771: Update Audit for handleRequest
Attached
Detach File
Event Timeline
Log In to Comment