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

Remove the obsolete "DiffusionInlineCommentPreviewController"

Summary: Ref T13513. This controller was obsoleted by EditEngine and appears unreachable without explicitly typing the URL.

Test Plan:
- Grepped for the route, didn't find any hits.
- Deleted the controller, successfully previewed comments in Diffusion.

Maniphest Tasks: T13513

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

-85
-4
src/__phutil_library_map__.php
··· 877 877 'DiffusionIdentityUnassignedDatasource' => 'applications/diffusion/typeahead/DiffusionIdentityUnassignedDatasource.php', 878 878 'DiffusionIdentityViewController' => 'applications/diffusion/controller/DiffusionIdentityViewController.php', 879 879 'DiffusionInlineCommentController' => 'applications/diffusion/controller/DiffusionInlineCommentController.php', 880 - 'DiffusionInlineCommentPreviewController' => 'applications/diffusion/controller/DiffusionInlineCommentPreviewController.php', 881 880 'DiffusionInternalAncestorsConduitAPIMethod' => 'applications/diffusion/conduit/DiffusionInternalAncestorsConduitAPIMethod.php', 882 881 'DiffusionInternalGitRawDiffQueryConduitAPIMethod' => 'applications/diffusion/conduit/DiffusionInternalGitRawDiffQueryConduitAPIMethod.php', 883 882 'DiffusionLastModifiedController' => 'applications/diffusion/controller/DiffusionLastModifiedController.php', ··· 3594 3593 'PhabricatorInfrastructureTestCase' => '__tests__/PhabricatorInfrastructureTestCase.php', 3595 3594 'PhabricatorInlineComment' => 'infrastructure/diff/interface/PhabricatorInlineComment.php', 3596 3595 'PhabricatorInlineCommentController' => 'infrastructure/diff/PhabricatorInlineCommentController.php', 3597 - 'PhabricatorInlineCommentPreviewController' => 'infrastructure/diff/PhabricatorInlineCommentPreviewController.php', 3598 3596 'PhabricatorInlineSummaryView' => 'infrastructure/diff/view/PhabricatorInlineSummaryView.php', 3599 3597 'PhabricatorInstructionsEditField' => 'applications/transactions/editfield/PhabricatorInstructionsEditField.php', 3600 3598 'PhabricatorIntConfigType' => 'applications/config/type/PhabricatorIntConfigType.php', ··· 6968 6966 'DiffusionIdentityUnassignedDatasource' => 'PhabricatorTypeaheadDatasource', 6969 6967 'DiffusionIdentityViewController' => 'DiffusionController', 6970 6968 'DiffusionInlineCommentController' => 'PhabricatorInlineCommentController', 6971 - 'DiffusionInlineCommentPreviewController' => 'PhabricatorInlineCommentPreviewController', 6972 6969 'DiffusionInternalAncestorsConduitAPIMethod' => 'DiffusionQueryConduitAPIMethod', 6973 6970 'DiffusionInternalGitRawDiffQueryConduitAPIMethod' => 'DiffusionQueryConduitAPIMethod', 6974 6971 'DiffusionLastModifiedController' => 'DiffusionController', ··· 10115 10112 'PhabricatorMarkupInterface', 10116 10113 ), 10117 10114 'PhabricatorInlineCommentController' => 'PhabricatorController', 10118 - 'PhabricatorInlineCommentPreviewController' => 'PhabricatorController', 10119 10115 'PhabricatorInlineSummaryView' => 'AphrontView', 10120 10116 'PhabricatorInstructionsEditField' => 'PhabricatorEditField', 10121 10117 'PhabricatorIntConfigType' => 'PhabricatorTextConfigType',
-2
src/applications/diffusion/application/PhabricatorDiffusionApplication.php
··· 140 140 141 141 'inline/' => array( 142 142 'edit/(?P<phid>[^/]+)/' => 'DiffusionInlineCommentController', 143 - 'preview/(?P<phid>[^/]+)/' 144 - => 'DiffusionInlineCommentPreviewController', 145 143 ), 146 144 'services/' => array( 147 145 'path/' => array(
-32
src/applications/diffusion/controller/DiffusionInlineCommentPreviewController.php
··· 1 - <?php 2 - 3 - final class DiffusionInlineCommentPreviewController 4 - extends PhabricatorInlineCommentPreviewController { 5 - 6 - protected function loadInlineComments() { 7 - $viewer = $this->getViewer(); 8 - 9 - return PhabricatorAuditInlineComment::loadDraftComments( 10 - $viewer, 11 - $this->getCommitPHID()); 12 - } 13 - 14 - protected function loadObjectOwnerPHID() { 15 - $viewer = $this->getViewer(); 16 - 17 - $commit = id(new DiffusionCommitQuery()) 18 - ->setViewer($viewer) 19 - ->withPHIDs(array($this->getCommitPHID())) 20 - ->executeOne(); 21 - if (!$commit) { 22 - return null; 23 - } 24 - 25 - return $commit->getAuthorPHID(); 26 - } 27 - 28 - private function getCommitPHID() { 29 - return $this->getRequest()->getURIData('phid'); 30 - } 31 - 32 - }
-47
src/infrastructure/diff/PhabricatorInlineCommentPreviewController.php
··· 1 - <?php 2 - 3 - abstract class PhabricatorInlineCommentPreviewController 4 - extends PhabricatorController { 5 - 6 - abstract protected function loadInlineComments(); 7 - abstract protected function loadObjectOwnerPHID(); 8 - 9 - public function processRequest() { 10 - $request = $this->getRequest(); 11 - $viewer = $request->getUser(); 12 - 13 - $inlines = $this->loadInlineComments(); 14 - assert_instances_of($inlines, 'PhabricatorInlineComment'); 15 - 16 - $engine = new PhabricatorMarkupEngine(); 17 - $engine->setViewer($viewer); 18 - foreach ($inlines as $inline) { 19 - $engine->addObject( 20 - $inline, 21 - PhabricatorInlineComment::MARKUP_FIELD_BODY); 22 - } 23 - $engine->process(); 24 - 25 - $phids = array($viewer->getPHID()); 26 - $handles = $this->loadViewerHandles($phids); 27 - $object_owner_phid = $this->loadObjectOwnerPHID(); 28 - 29 - $views = array(); 30 - foreach ($inlines as $inline) { 31 - $view = id(new PHUIDiffInlineCommentDetailView()) 32 - ->setUser($viewer) 33 - ->setInlineComment($inline) 34 - ->setMarkupEngine($engine) 35 - ->setHandles($handles) 36 - ->setEditable(false) 37 - ->setPreview(true) 38 - ->setCanMarkDone(false) 39 - ->setObjectOwnerPHID($object_owner_phid); 40 - $views[] = $view->render(); 41 - } 42 - $views = phutil_implode_html("\n", $views); 43 - 44 - return id(new AphrontAjaxResponse()) 45 - ->setContent($views); 46 - } 47 - }