1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-23 14:00:56 +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) {
$item = id(new PhabricatorMenuItemView())
->setType(PhabricatorMenuItemView::TYPE_LABEL)
->setName($name)
->setKey($key);
->setName($name);
if ($key !== null) {
$item->setKey($key);
}
$this->addMenuItem($item);
@ -23,8 +26,11 @@ final class PhabricatorMenuView extends AphrontTagView {
$item = id(new PhabricatorMenuItemView())
->setType(PhabricatorMenuItemView::TYPE_LINK)
->setName($name)
->setHref($href)
->setKey($key);
->setHref($href);
if ($key !== null) {
$key->setKey($key);
}
$this->addMenuItem($item);