mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-27 09:12:41 +01:00
Minor, fix an issue with PhabricatorMenuView and default null keys.
This is kind of gross, but breaking some menus right now which end up with double-`''` keys. The current meaning of setKey(null) is different from not calling it (it means `setKey('')`). This should be fixed more reasonably but there's a lot of legacy cruft in PhabricatorSideNavFilterView. Auditors: btrahan
This commit is contained in:
parent
57c001f522
commit
84efcb8669
1 changed files with 10 additions and 4 deletions
|
@ -11,8 +11,11 @@ final class PhabricatorMenuView extends AphrontTagView {
|
||||||
public function newLabel($name, $key = null) {
|
public function newLabel($name, $key = null) {
|
||||||
$item = id(new PhabricatorMenuItemView())
|
$item = id(new PhabricatorMenuItemView())
|
||||||
->setType(PhabricatorMenuItemView::TYPE_LABEL)
|
->setType(PhabricatorMenuItemView::TYPE_LABEL)
|
||||||
->setName($name)
|
->setName($name);
|
||||||
->setKey($key);
|
|
||||||
|
if ($key !== null) {
|
||||||
|
$item->setKey($key);
|
||||||
|
}
|
||||||
|
|
||||||
$this->addMenuItem($item);
|
$this->addMenuItem($item);
|
||||||
|
|
||||||
|
@ -23,8 +26,11 @@ final class PhabricatorMenuView extends AphrontTagView {
|
||||||
$item = id(new PhabricatorMenuItemView())
|
$item = id(new PhabricatorMenuItemView())
|
||||||
->setType(PhabricatorMenuItemView::TYPE_LINK)
|
->setType(PhabricatorMenuItemView::TYPE_LINK)
|
||||||
->setName($name)
|
->setName($name)
|
||||||
->setHref($href)
|
->setHref($href);
|
||||||
->setKey($key);
|
|
||||||
|
if ($key !== null) {
|
||||||
|
$key->setKey($key);
|
||||||
|
}
|
||||||
|
|
||||||
$this->addMenuItem($item);
|
$this->addMenuItem($item);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue