diff --git a/htdocs/variants/combinations.php b/htdocs/variants/combinations.php index 3a2936d0df5..24da596f3c2 100644 --- a/htdocs/variants/combinations.php +++ b/htdocs/variants/combinations.php @@ -227,7 +227,7 @@ if (($action == 'add' || $action == 'create') && empty($massaction) && !GETPOST( $db->commit(); setEventMessages($langs->trans('RecordSaved'), null, 'mesgs'); } -} elseif ($valueid > 0) { +} elseif ($action === 'update' && $valueid > 0) { if ($prodcomb->fetch($valueid) < 0) { dol_print_error($db, $langs->trans('ErrorRecordNotFound')); exit(); diff --git a/htdocs/variants/create.php b/htdocs/variants/create.php index 84530e01cb5..e37548f39f3 100644 --- a/htdocs/variants/create.php +++ b/htdocs/variants/create.php @@ -29,7 +29,7 @@ $action = GETPOST('action', 'alpha'); * Actions */ -if ($action == 'create') { +if ($action == 'add') { if (empty($ref) || empty($label)) { setEventMessages($langs->trans('ErrorFieldsRequired'), null, 'errors'); } else {