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:
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) {
|
||||
$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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue