From 84952a539b295f0d9594fcea5e9a2f6975848c14 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Thu, 22 Dec 2005 16:49:33 +0000 Subject: [PATCH] previous fix introduced a bug: cannot change a value for a nullable field --- ChangeLog | 2 ++ libraries/tbl_replace_fields.inc.php | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 2525f0206..6a6266157 100755 --- a/ChangeLog +++ b/ChangeLog @@ -10,6 +10,8 @@ $Source$ Cannot edit a table having 40 columns * libraries/common.lib.php: bug #1388116, cannot pass TRUE by reference to PMA_setCookie, thanks to Isaac Bennetch + * libraries/tbl_replace_fields.inc.php: recent fix introduced a bug: + cannot change a value for a nullable field 2005-12-21 Marc Delisle * lang/danish: Updated, thanks to AlleyKat - dk_alleykat diff --git a/libraries/tbl_replace_fields.inc.php b/libraries/tbl_replace_fields.inc.php index db5164746..716a39a3a 100644 --- a/libraries/tbl_replace_fields.inc.php +++ b/libraries/tbl_replace_fields.inc.php @@ -215,7 +215,8 @@ if (!$check_stop) { $val = 'NULL'; } - if (isset($me_fields_null_prev) && isset($me_fields_null_prev[$encoded_key]) && !isset($me_fields_null[$encoded_key])) { + // The Null checkbox was unchecked for this field + if (empty($val) && isset($me_fields_null_prev) && isset($me_fields_null_prev[$encoded_key]) && !isset($me_fields_null[$encoded_key])) { $val = "''"; } } // end else (field value in the form)