noalyss-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Noalyss-commit] [noalyss] 06/86: CFGMENU : bug cannot update menu


From: dwm
Subject: [Noalyss-commit] [noalyss] 06/86: CFGMENU : bug cannot update menu
Date: Thu, 19 Sep 2024 02:41:47 -0400 (EDT)

sparkyx pushed a commit to branch unstable
in repository noalyss.

commit 6e1c536564e31815a2f42e9e2a223e35f572e3f1
Author: sparkyx <danydb@noalyss.eu>
AuthorDate: Sun Sep 1 22:01:00 2024 +0200

    CFGMENU : bug cannot update menu
---
 include/class/menu_ref.class.php | 4 +++-
 include/menu.inc.php             | 1 +
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/include/class/menu_ref.class.php b/include/class/menu_ref.class.php
index aab3b5f0c..f86c0c0a0 100644
--- a/include/class/menu_ref.class.php
+++ b/include/class/menu_ref.class.php
@@ -45,8 +45,10 @@ class Menu_Ref extends Menu_Ref_SQL
         {
              throw new Exception(_("le code ne peut être vide"));
         }
+
             $this->format_code();
-            if ( $this->cn->get_value("select count(*) from menu_ref where 
me_code=$1",array($this->me_code)) > 0)
+            if (isset ($_POST['create_menu'])
+                && $this->cn->get_value("select count(*) from menu_ref where 
me_code=$1",array($this->me_code)) > 0)
                     throw new Exception ('Doublon');
             if (trim($this->me_code)=='')
                     throw new Exception ('Ce menu existe déjà');
diff --git a/include/menu.inc.php b/include/menu.inc.php
index 47b626611..0dbdd3c06 100644
--- a/include/menu.inc.php
+++ b/include/menu.inc.php
@@ -86,6 +86,7 @@ if ( isset($_POST['create_menu'])|| 
isset($_POST['modify_menu']))
        {
                if (isset($_POST['create_menu']))
                {
+                       if ($menu_ref->verify() == 0)
                        $menu_ref->insert();
                }
                elseif (isset($_POST['modify_menu']))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]