From ad21f1e293283088ebfef56a4c2d9030bd99a00d Mon Sep 17 00:00:00 2001 From: bahfir abbes Date: Tue, 13 Oct 2020 23:49:38 +0100 Subject: [PATCH] fix:boolean values in showinputfield are 1 and 0 not 'on' and 'off' --- htdocs/core/actions_addupdatedelete.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/actions_addupdatedelete.inc.php b/htdocs/core/actions_addupdatedelete.inc.php index cee75415eee..ad82d15c5a9 100644 --- a/htdocs/core/actions_addupdatedelete.inc.php +++ b/htdocs/core/actions_addupdatedelete.inc.php @@ -74,7 +74,7 @@ if ($action == 'add' && !empty($permissiontoadd)) } elseif (preg_match('/^(integer|price|real|double)/', $object->fields[$key]['type'])) { $value = price2num(GETPOST($key, 'alphanohtml')); // To fix decimal separator according to lang setup } elseif ($object->fields[$key]['type'] == 'boolean') { - $value = (GETPOST($key) == 'on' ? 1 : 0); + $value = (GETPOST($key) == '1' ? 1 : 0); } else { $value = GETPOST($key, 'alphanohtml'); }