diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index 404a26f1e7..a97804d2df 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -1851,7 +1851,7 @@ phutil_register_library_map(array( 'DifferentialPathFieldSpecification' => 'DifferentialFieldSpecification', 'DifferentialPeopleMenuEventListener' => 'PhutilEventListener', 'DifferentialPrimaryPaneView' => 'AphrontView', - 'DifferentialRemarkupRule' => 'PhabricatorRemarkupRuleObjectName', + 'DifferentialRemarkupRule' => 'PhabricatorRemarkupRuleObject', 'DifferentialReplyHandler' => 'PhabricatorMailReplyHandler', 'DifferentialResultsTableView' => 'AphrontView', 'DifferentialRevertPlanFieldSpecification' => 'DifferentialFieldSpecification', @@ -2071,7 +2071,7 @@ phutil_register_library_map(array( 'ManiphestEdgeEventListener' => 'PhutilEventListener', 'ManiphestExportController' => 'ManiphestController', 'ManiphestPeopleMenuEventListener' => 'PhutilEventListener', - 'ManiphestRemarkupRule' => 'PhabricatorRemarkupRuleObjectName', + 'ManiphestRemarkupRule' => 'PhabricatorRemarkupRuleObject', 'ManiphestReplyHandler' => 'PhabricatorMailReplyHandler', 'ManiphestReportController' => 'ManiphestController', 'ManiphestSavedQuery' => 'ManiphestDAO', @@ -2604,7 +2604,7 @@ phutil_register_library_map(array( 'PhabricatorPasteEditController' => 'PhabricatorPasteController', 'PhabricatorPasteListController' => 'PhabricatorPasteController', 'PhabricatorPasteQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', - 'PhabricatorPasteRemarkupRule' => 'PhabricatorRemarkupRuleObjectName', + 'PhabricatorPasteRemarkupRule' => 'PhabricatorRemarkupRuleObject', 'PhabricatorPasteViewController' => 'PhabricatorPasteController', 'PhabricatorPeopleController' => 'PhabricatorController', 'PhabricatorPeopleEditController' => 'PhabricatorPeopleController', @@ -3028,7 +3028,7 @@ phutil_register_library_map(array( 'PonderQuestionQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', 'PonderQuestionSummaryView' => 'AphrontView', 'PonderQuestionViewController' => 'PonderController', - 'PonderRemarkupRule' => 'PhabricatorRemarkupRuleObjectName', + 'PonderRemarkupRule' => 'PhabricatorRemarkupRuleObject', 'PonderReplyHandler' => 'PhabricatorMailReplyHandler', 'PonderSearchIndexer' => 'PhabricatorSearchDocumentIndexer', 'PonderUserProfileView' => 'AphrontView', diff --git a/src/applications/differential/remarkup/DifferentialRemarkupRule.php b/src/applications/differential/remarkup/DifferentialRemarkupRule.php index 2188b4f3a0..4ef3d7b7d0 100644 --- a/src/applications/differential/remarkup/DifferentialRemarkupRule.php +++ b/src/applications/differential/remarkup/DifferentialRemarkupRule.php @@ -1,13 +1,26 @@ getEngine()->getConfig('viewer'); + + if (!$viewer) { + return array(); + } + + return id(new DifferentialRevisionQuery()) + ->setViewer($viewer) + ->withIDs($ids) + ->execute(); + } + } diff --git a/src/applications/maniphest/remarkup/ManiphestRemarkupRule.php b/src/applications/maniphest/remarkup/ManiphestRemarkupRule.php index 01e52a0e15..0f09eab057 100644 --- a/src/applications/maniphest/remarkup/ManiphestRemarkupRule.php +++ b/src/applications/maniphest/remarkup/ManiphestRemarkupRule.php @@ -1,13 +1,26 @@ getEngine()->getConfig('viewer'); + + if (!$viewer) { + return array(); + } + + return id(new ManiphestTaskQuery()) + ->setViewer($viewer) + ->withTaskIDs($ids) + ->execute(); + } + } diff --git a/src/applications/paste/remarkup/PhabricatorPasteRemarkupRule.php b/src/applications/paste/remarkup/PhabricatorPasteRemarkupRule.php index 20d04545b5..ef6bfb96cd 100644 --- a/src/applications/paste/remarkup/PhabricatorPasteRemarkupRule.php +++ b/src/applications/paste/remarkup/PhabricatorPasteRemarkupRule.php @@ -4,10 +4,24 @@ * @group markup */ final class PhabricatorPasteRemarkupRule - extends PhabricatorRemarkupRuleObjectName { + extends PhabricatorRemarkupRuleObject { protected function getObjectNamePrefix() { return 'P'; } + protected function loadObjects(array $ids) { + $viewer = $this->getEngine()->getConfig('viewer'); + + if (!$viewer) { + return array(); + } + + return id(new PhabricatorPasteQuery()) + ->setViewer($viewer) + ->withIDs($ids) + ->execute(); + + } + } diff --git a/src/applications/ponder/remarkup/PonderRemarkupRule.php b/src/applications/ponder/remarkup/PonderRemarkupRule.php index a698052b9e..83944e5c80 100644 --- a/src/applications/ponder/remarkup/PonderRemarkupRule.php +++ b/src/applications/ponder/remarkup/PonderRemarkupRule.php @@ -1,13 +1,36 @@ getEngine()->getConfig('viewer'); + + if (!$viewer) { + return array(); + } + + return id(new PonderQuestionQuery()) + ->setViewer($viewer) + ->withIDs($ids) + ->execute(); + } + + protected function shouldMarkupObject(array $params) { + // NOTE: Q1, Q2, Q3 and Q4 are often used to refer to quarters of the year; + // mark them up only in the {Q1} format. + if ($params['type'] == 'ref') { + if ($params['id'] <= 4) { + return false; + } + } + + return true; + } + }