1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-03-24 02:01:01 +01:00

Fix issue with rendering policy controls when an install has zero projects

Fixes T10290.

Auditors: cahd
This commit is contained in:
epriestley 2016-02-06 04:46:46 -08:00
parent 1db4de7dbc
commit 74825fccc4

View file

@ -167,12 +167,17 @@ final class AphrontFormPolicyControl extends AphrontFormControl {
$type_project = PhabricatorPolicyType::TYPE_PROJECT;
// Make sure we have a "Projects" group before we adjust it.
if (empty($options[$type_project])) {
$options[$type_project] = array();
}
$options[$type_project] = isort($options[$type_project], 'sort');
$placeholder = id(new PhabricatorPolicy())
->setName(pht('Other Project...'))
->setIcon('fa-search');
$options[$type_project] = isort($options[$type_project], 'sort');
$options[$type_project][$this->getSelectProjectKey()] = array(
'name' => $placeholder->getName(),
'full' => $placeholder->getName(),