From 9c9e1b776c72f815aad55bf904e9e1a38db4ebdd Mon Sep 17 00:00:00 2001 From: Christian Humpel Date: Sat, 20 Aug 2022 19:19:31 +0200 Subject: [PATCH 1/2] Fix: left menu can't create. Now the check is correct. --- htdocs/admin/menus/edit.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/menus/edit.php b/htdocs/admin/menus/edit.php index bf4ac3f8979..03dc761edf5 100644 --- a/htdocs/admin/menus/edit.php +++ b/htdocs/admin/menus/edit.php @@ -177,7 +177,7 @@ if ($action == 'add') { $action = 'create'; $error++; } - if (!$error && !GETPOST('menuId') && GETPOST('type') == 'left') { + if (!$error && !GETPOST('menuId') && GETPOST('type') != 'left') { setEventMessages($langs->trans("ErrorLeftMenuMustHaveAParentId"), null, 'errors'); $action = 'create'; $error++; From fbadce46c5e7518c7b19ba8c2428ba685fa1161b Mon Sep 17 00:00:00 2001 From: Christian Humpel Date: Sun, 21 Aug 2022 22:33:41 +0200 Subject: [PATCH 2/2] Fix: left and top menu can't create. Now the checks are correct. GETPOST with method 3 (POST then GET). --- htdocs/admin/menus/edit.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/menus/edit.php b/htdocs/admin/menus/edit.php index 03dc761edf5..9378fc28bbe 100644 --- a/htdocs/admin/menus/edit.php +++ b/htdocs/admin/menus/edit.php @@ -172,12 +172,12 @@ if ($action == 'add') { $action = 'create'; $error++; } - if (!$error && GETPOST('menuId') && GETPOST('type') == 'top') { + if (!$error && GETPOST('menuId', 'alphanohtml', 3) && GETPOST('type') == 'top') { setEventMessages($langs->trans("ErrorTopMenuMustHaveAParentWithId0"), null, 'errors'); $action = 'create'; $error++; } - if (!$error && !GETPOST('menuId') && GETPOST('type') != 'left') { + if (!$error && !GETPOST('menuId', 'alphanohtml', 3) && GETPOST('type') == 'left') { setEventMessages($langs->trans("ErrorLeftMenuMustHaveAParentId"), null, 'errors'); $action = 'create'; $error++;