diff --git a/htdocs/admin/menus/edit.php b/htdocs/admin/menus/edit.php index 360a4e96eb3..81bcaf26a9a 100644 --- a/htdocs/admin/menus/edit.php +++ b/htdocs/admin/menus/edit.php @@ -59,7 +59,8 @@ foreach ($dirmenus as $dirmenu) { $action = GETPOST('action', 'aZ09'); -$menu = null; +$menu = new Menubase($db); + $menu_handler_top = getDolGlobalString('MAIN_MENU_STANDARD'); $menu_handler_smartphone = getDolGlobalString('MAIN_MENU_SMARTPHONE'); $menu_handler_top = preg_replace('/_backoffice.php/i', '', $menu_handler_top); @@ -137,7 +138,6 @@ if ($action == 'add') { } if (!$error) { - $menu = new Menubase($db); $menu->menu_handler = preg_replace('/_menu$/', '', GETPOST('menu_handler', 'aZ09')); $menu->type = (string) GETPOST('type', 'alphanohtml'); $menu->title = (string) GETPOST('titre', 'alphanohtml'); @@ -197,7 +197,6 @@ if ($action == 'update') { } if (!$error) { - $menu = new Menubase($db); $result = $menu->fetch(GETPOSTINT('menuId')); if ($result > 0) { $menu->title = (string) GETPOST('titre', 'alphanohtml'); @@ -404,8 +403,8 @@ if ($action == 'create') { // Target print '