1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-23 07: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:
epriestley 2013-02-06 11:41:57 -08:00
parent 57c001f522
commit 84efcb8669

View file

@ -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);