diff options
author | diosmosis <benakamoorthi@fastmail.fm> | 2014-04-02 22:07:44 +0400 |
---|---|---|
committer | diosmosis <benakamoorthi@fastmail.fm> | 2014-04-02 22:09:36 +0400 |
commit | c604bb6e4943f01b75015f09662c49bb51d39198 (patch) | |
tree | bd2dc7af5a29c8910bb802450fb2c4d95c77ccd4 /core | |
parent | 47cd0bb26dab99fb9917a7cf64c5c9fbed358ece (diff) |
Fix bug in editing menu item: if subcategory is null, menu item is not changed.
Diffstat (limited to 'core')
-rw-r--r-- | core/Menu/MenuAbstract.php | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/core/Menu/MenuAbstract.php b/core/Menu/MenuAbstract.php index 1d35509e36..781aed7b81 100644 --- a/core/Menu/MenuAbstract.php +++ b/core/Menu/MenuAbstract.php @@ -163,10 +163,17 @@ abstract class MenuAbstract extends Singleton $mainMenuToEdit = $edit[0]; $subMenuToEdit = $edit[1]; $newUrl = $edit[2]; - if (!isset($this->menu[$mainMenuToEdit][$subMenuToEdit])) { + + if ($subMenuToEdit === null) { + $menuDataToEdit = @$this->menu[$mainMenuToEdit]; + } else { + $menuDataToEdit = @$this->menu[$mainMenuToEdit][$subMenuToEdit]; + } + + if (empty($menuDataToEdit)) { $this->buildMenuItem($mainMenuToEdit, $subMenuToEdit, $newUrl); } else { - $this->menu[$mainMenuToEdit][$subMenuToEdit]['_url'] = $newUrl; + $menuDataToEdit['_url'] = $newUrl; } } } |