From 8b4c3ef80cf045d655a59bcf2a07228ed42a7ef9 Mon Sep 17 00:00:00 2001 From: yannis Date: Thu, 3 Jul 2025 12:08:46 +0200 Subject: [PATCH] fix: bad test that unable to create token --- htdocs/user/api_token/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/user/api_token/card.php b/htdocs/user/api_token/card.php index 26257b1ba80..c0682d35da9 100644 --- a/htdocs/user/api_token/card.php +++ b/htdocs/user/api_token/card.php @@ -286,7 +286,7 @@ if (empty($reshook)) { } else { dol_print_error($db); } - if (empty($nbtotalofrecords) || $nbtotalofrecords > 0) { + if (!empty($nbtotalofrecords) && $nbtotalofrecords > 0) { setEventMessages($langs->trans("ErrorFieldExist", $langs->transnoentitiesnoconv("ApiToken")), null, 'errors'); $action = 'create'; $error++;