diff --git a/htdocs/categories/edit.php b/htdocs/categories/edit.php index 954241e655d..2a42576a9d7 100644 --- a/htdocs/categories/edit.php +++ b/htdocs/categories/edit.php @@ -50,7 +50,7 @@ if ($_POST["action"] == 'update' && $user->rights->categorie->creer) $categorie->label = $_POST["nom"]; $categorie->description = $_POST["description"]; - $categorie->socid = $_POST["socid"]; + $categorie->socid = ($_POST["socid"] ? $_POST["socid"] : 'null'); $categorie->visible = $_POST["visible"]; if($_POST['catMere'] != "-1") diff --git a/htdocs/categories/fiche.php b/htdocs/categories/fiche.php index 983c35e3819..6ea75c4c76b 100644 --- a/htdocs/categories/fiche.php +++ b/htdocs/categories/fiche.php @@ -100,7 +100,7 @@ if ($_POST["action"] == 'add' && $user->rights->categorie->creer) $categorie->label = $_POST["nom"]; $categorie->description = $_POST["description"]; - $categorie->socid = $_POST["socid"]; + $categorie->socid = ($_POST["socid"] ? $_POST["socid"] : 'null'); $categorie->visible = $_POST["visible"]; $categorie->type = $_POST["type"];