Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14069590
D13469.id32593.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
D13469.id32593.diff
View Options
diff --git a/src/applications/transactions/controller/PhabricatorApplicationTransactionCommentEditController.php b/src/applications/transactions/controller/PhabricatorApplicationTransactionCommentEditController.php
--- a/src/applications/transactions/controller/PhabricatorApplicationTransactionCommentEditController.php
+++ b/src/applications/transactions/controller/PhabricatorApplicationTransactionCommentEditController.php
@@ -3,21 +3,13 @@
final class PhabricatorApplicationTransactionCommentEditController
extends PhabricatorApplicationTransactionController {
- private $phid;
-
- public function willProcessRequest(array $data) {
- $this->phid = $data['phid'];
- }
-
- public function processRequest() {
- $request = $this->getRequest();
- $user = $request->getUser();
+ public function handleRequest(AphrontRequest $request) {
+ $viewer = $this->getViewer();
$xaction = id(new PhabricatorObjectQuery())
- ->withPHIDs(array($this->phid))
- ->setViewer($user)
+ ->setViewer($viewer)
+ ->withPHIDs(array($request->getURIData('phid')))
->executeOne();
-
if (!$xaction) {
return new Aphront404Response();
}
@@ -33,11 +25,9 @@
return new Aphront400Response();
}
- $obj_phid = $xaction->getObjectPHID();
- $obj_handle = id(new PhabricatorHandleQuery())
- ->setViewer($user)
- ->withPHIDs(array($obj_phid))
- ->executeOne();
+ $phid = $xaction->getObjectPHID();
+ $handles = $viewer->loadHandles(array($phid));
+ $obj_handle = $handles[$phid];
if ($request->isDialogFormPost()) {
$text = $request->getStr('text');
@@ -49,7 +39,7 @@
}
$editor = id(new PhabricatorApplicationTransactionCommentEditor())
- ->setActor($user)
+ ->setActor($viewer)
->setContentSource(PhabricatorContentSource::newFromRequest($request))
->applyEdit($xaction, $comment);
@@ -60,28 +50,20 @@
}
}
- $dialog = id(new AphrontDialogView())
- ->setUser($user)
- ->setSubmitURI(
- $this->getApplicationURI('/transactions/edit/'.$xaction->getPHID().'/'))
- ->setTitle(pht('Edit Comment'));
+ $form = id(new AphrontFormView())
+ ->setUser($viewer)
+ ->setFullWidth(true)
+ ->appendControl(
+ id(new PhabricatorRemarkupControl())
+ ->setName('text')
+ ->setValue($xaction->getComment()->getContent()));
- $dialog
+ return $this->newDialog()
+ ->setTitle(pht('Edit Comment'))
->addHiddenInput('anchor', $request->getStr('anchor'))
- ->appendChild(
- id(new PHUIFormLayoutView())
- ->setFullWidth(true)
- ->appendChild(
- id(new PhabricatorRemarkupControl())
- ->setUser($user)
- ->setName('text')
- ->setValue($xaction->getComment()->getContent())));
-
- $dialog
+ ->appendForm($form)
->addSubmitButton(pht('Save Changes'))
->addCancelButton($obj_handle->getURI());
-
- return id(new AphrontDialogResponse())->setDialog($dialog);
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Nov 21, 8:30 AM (21 h, 54 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6714326
Default Alt Text
D13469.id32593.diff (3 KB)
Attached To
Mode
D13469: Modernize transaction comment editor
Attached
Detach File
Event Timeline
Log In to Comment