id = $data['id']; } public function processRequest() { $request = $this->getRequest(); $user = $request->getUser(); $commit = id(new PhabricatorRepositoryCommit())->load($this->id); if (!$commit) { return new Aphront404Response(); } $comment = id(new PhabricatorAuditComment()) ->setActorPHID($user->getPHID()) ->setTargetPHID($commit->getPHID()) ->setAction($request->getStr('action')) ->setContent($request->getStr('content')); $view = id(new DiffusionCommentView()) ->setUser($user) ->setComment($comment) ->setIsPreview(true); $phids = $view->getRequiredHandlePHIDs(); $handles = id(new PhabricatorObjectHandleData($phids))->loadHandles(); $view->setHandles($handles); id(new PhabricatorDraft()) ->setAuthorPHID($comment->getActorPHID()) ->setDraftKey('diffusion-audit-'.$this->id) ->setDraft($comment->getContent()) ->replace(); return id(new AphrontAjaxResponse()) ->setContent($view->render()); } }