diff --git a/src/applications/diffusion/controller/DiffusionRepositoryEditMainController.php b/src/applications/diffusion/controller/DiffusionRepositoryEditMainController.php --- a/src/applications/diffusion/controller/DiffusionRepositoryEditMainController.php +++ b/src/applications/diffusion/controller/DiffusionRepositoryEditMainController.php @@ -377,7 +377,7 @@ $repository); $view_parts = array(); - if (PhabricatorSpacesNamespaceQuery::getViewerSpacesExist($viewer)) { + if (PhabricatorSpacesNamespaceQuery::getViewerActiveSpacesExist($viewer)) { $space_phid = PhabricatorSpacesNamespaceQuery::getObjectSpacePHID( $repository); $view_parts[] = $viewer->renderHandle($space_phid); diff --git a/src/applications/metamta/applicationpanel/PhabricatorMetaMTAApplicationEmailPanel.php b/src/applications/metamta/applicationpanel/PhabricatorMetaMTAApplicationEmailPanel.php --- a/src/applications/metamta/applicationpanel/PhabricatorMetaMTAApplicationEmailPanel.php +++ b/src/applications/metamta/applicationpanel/PhabricatorMetaMTAApplicationEmailPanel.php @@ -239,7 +239,7 @@ ->setValue($v_email) ->setError($e_email)); - if (PhabricatorSpacesNamespaceQuery::getViewerSpacesExist($viewer)) { + if (PhabricatorSpacesNamespaceQuery::getViewerActiveSpacesExist($viewer)) { $form->appendControl( id(new AphrontFormSelectControl()) ->setLabel(pht('Space')) @@ -395,7 +395,7 @@ $table->setRowClasses($rowc); $table->setColumnVisibility( array( - PhabricatorSpacesNamespaceQuery::getViewerSpacesExist($viewer), + PhabricatorSpacesNamespaceQuery::getViewerActiveSpacesExist($viewer), true, $is_edit, $is_edit, diff --git a/src/applications/spaces/query/PhabricatorSpacesNamespaceQuery.php b/src/applications/spaces/query/PhabricatorSpacesNamespaceQuery.php --- a/src/applications/spaces/query/PhabricatorSpacesNamespaceQuery.php +++ b/src/applications/spaces/query/PhabricatorSpacesNamespaceQuery.php @@ -103,6 +103,17 @@ return (count($spaces) > 1); } + public static function getViewerActiveSpacesExist(PhabricatorUser $viewer) { + if (!self::getSpacesExist()) { + return false; + } + + // If the viewer has access to only one active space, pretend active spaces + // simply don't exist. + $spaces = self::getViewerActiveSpaces($viewer); + return (count($spaces) > 1); + } + public static function getAllSpaces() { $cache = PhabricatorCaches::getRequestCache(); $cache_key = self::KEY_ALL; diff --git a/src/view/form/control/AphrontFormPolicyControl.php b/src/view/form/control/AphrontFormPolicyControl.php --- a/src/view/form/control/AphrontFormPolicyControl.php +++ b/src/view/form/control/AphrontFormPolicyControl.php @@ -335,7 +335,7 @@ } $viewer = $this->getUser(); - if (!PhabricatorSpacesNamespaceQuery::getViewerSpacesExist($viewer)) { + if (!PhabricatorSpacesNamespaceQuery::getViewerActiveSpacesExist($viewer)) { return null; } diff --git a/webroot/rsrc/js/application/maniphest/behavior-batch-editor.js b/webroot/rsrc/js/application/maniphest/behavior-batch-editor.js --- a/webroot/rsrc/js/application/maniphest/behavior-batch-editor.js +++ b/webroot/rsrc/js/application/maniphest/behavior-batch-editor.js @@ -25,7 +25,7 @@ 'assign': 'Assign', 'add_ccs' : 'Add CCs', 'remove_ccs' : 'Remove CCs', - 'space': 'Shift to Space' + 'space': 'Shift to Space' // TODO : ask !core how to properly mask this }); var proj_tokenizer = build_tokenizer(config.sources.project);