bug 638275

This commit is contained in:
Marc Delisle
2002-11-16 11:24:06 +00:00
parent b59ac08abb
commit 8a2ed5cce4
2 changed files with 12 additions and 3 deletions

View File

@@ -8,6 +8,9 @@ $Source$
2002-11-16 Marc Delisle <lem9@users.sourceforge.net> 2002-11-16 Marc Delisle <lem9@users.sourceforge.net>
* libraries/build_dump.lib.php3: fix for old MySQL, thanks to * libraries/build_dump.lib.php3: fix for old MySQL, thanks to
Flavio Poletti (flavio at polettix.it) Flavio Poletti (flavio at polettix.it)
* tbl_replace.php3: bug 638275: ignore NULL checkbox is there is
a value for the field (possible if js is disabled, or broken browser
like Konqueror 2.2.2); implemented on insert or update
2002-11-08 Robin Johnson <robbat2@users.sourceforge.net> 2002-11-08 Robin Johnson <robbat2@users.sourceforge.net>
* lib/sqlparser.data.php3: Bug #639291 fixed * lib/sqlparser.data.php3: Bug #639291 fixed

View File

@@ -143,7 +143,10 @@ if (isset($primary_key) && ($submit_type != $strInsertAsNewRow)) {
} // end switch } // end switch
// Was the Null checkbox checked for this field? // Was the Null checkbox checked for this field?
if (isset($fields_null) && isset($fields_null[$encoded_key])) { // (if there is a value, we ignore the Null checkbox: this could
// be possible if Javascript is disabled in the browser)
if (isset($fields_null) && isset($fields_null[$encoded_key])
&& $val=="''") {
$val = 'NULL'; $val = 'NULL';
} }
@@ -165,7 +168,7 @@ if (isset($primary_key) && ($submit_type != $strInsertAsNewRow)) {
} }
} // end while } // end while
// Builds the sql upate query // Builds the sql update query
$valuelist = ereg_replace(', $', '', $valuelist); $valuelist = ereg_replace(', $', '', $valuelist);
if (!empty($valuelist)) { if (!empty($valuelist)) {
$query = 'UPDATE ' . PMA_backquote($table) . ' SET ' . $valuelist . ' WHERE' . $primary_key $query = 'UPDATE ' . PMA_backquote($table) . ' SET ' . $valuelist . ' WHERE' . $primary_key
@@ -249,7 +252,10 @@ else {
} // end switch } // end switch
// Was the Null checkbox checked for this field? // Was the Null checkbox checked for this field?
if (isset($fields_null) && isset($fields_null[$encoded_key])) { // (if there is a value, we ignore the Null checkbox: this could
// be possible if Javascript is disabled in the browser)
if (isset($fields_null) && isset($fields_null[$encoded_key])
&& $val=="''") {
$val = 'NULL'; $val = 'NULL';
} }