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

Don't offer personal saved queries in global "Search Scope" settings dropdown

Summary: Fixes T13405. We currently offer non-global custom saved queries here, but this doesn't make sense as a global default setting.

Test Plan: Saved a global search query, edited global search settings, no longer saw the non-global query as an option.

Maniphest Tasks: T13405

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

+16 -4
+2 -1
src/applications/settings/setting/PhabricatorSearchScopeSetting.php
··· 25 25 protected function getSelectOptions() { 26 26 $scopes = PhabricatorMainMenuSearchView::getGlobalSearchScopeItems( 27 27 $this->getViewer(), 28 - new PhabricatorSettingsApplication()); 28 + new PhabricatorSettingsApplication(), 29 + $only_global = true); 29 30 30 31 $scope_map = array(); 31 32 foreach ($scopes as $scope) {
+14 -3
src/view/page/menu/PhabricatorMainMenuSearchView.php
··· 118 118 119 119 public static function getGlobalSearchScopeItems( 120 120 PhabricatorUser $viewer, 121 - PhabricatorApplication $application = null) { 121 + PhabricatorApplication $application = null, 122 + $global_only = false) { 122 123 123 124 $items = array(); 124 125 $items[] = array( ··· 154 155 $engine = id(new PhabricatorSearchApplicationSearchEngine()) 155 156 ->setViewer($viewer); 156 157 $engine_queries = $engine->loadEnabledNamedQueries(); 157 - $query_map = mpull($engine_queries, 'getQueryName', 'getQueryKey'); 158 - foreach ($query_map as $query_key => $query_name) { 158 + foreach ($engine_queries as $query) { 159 + $query_key = $query->getQueryKey(); 159 160 if ($query_key == 'all') { 160 161 // Skip the builtin "All" query since it's redundant with the default 161 162 // setting. 162 163 continue; 163 164 } 165 + 166 + // In the global "Settings" panel, we don't want to offer personal 167 + // queries the viewer may have saved. 168 + if ($global_only) { 169 + if (!$query->isGlobal()) { 170 + continue; 171 + } 172 + } 173 + 174 + $query_name = $query->getQueryName(); 164 175 165 176 $items[] = array( 166 177 'icon' => 'fa-certificate',