diff --git a/edit.inc.php b/edit.inc.php index cbaf4749..43040bf9 100644 --- a/edit.inc.php +++ b/edit.inc.php @@ -47,8 +47,8 @@ if ($_POST["save"]) { } elseif ($where) { $select = array(); foreach ($fields as $name => $field) { - if (isset($field["privileges"]["select"]) && (!$_POST["clone"] || !$field["auto_increment"])) { - $select[] = ($field["type"] == "enum" || $field["type"] == "set" ? "1*" . idf_escape($name) . " AS " : "") . idf_escape($name); + if (isset($field["privileges"]["select"])) { + $select[] = ($_POST["clone"] && $field["auto_increment"] ? "'' AS " : ($field["type"] == "enum" || $field["type"] == "set" ? "1*" . idf_escape($name) . " AS " : "")) . idf_escape($name); } } $row = array(); @@ -67,7 +67,7 @@ if ($fields) { echo "\n"; foreach ($fields as $name => $field) { echo ""; - $value = (!isset($row) ? ($_POST["clone"] && $field["auto_increment"] ? "" : $field["default"]) + $value = (!isset($row) ? ($_POST["clone"] && $field["auto_increment"] ? "" : ($where ? $field["default"] : null)) : (strlen($row[$name]) && ($field["type"] == "enum" || $field["type"] == "set") ? intval($row[$name]) : $row[$name]) ); input($name, $field, $value); diff --git a/todo.txt b/todo.txt index 4805ef5d..0217d9d4 100644 --- a/todo.txt +++ b/todo.txt @@ -10,6 +10,7 @@ Function to fix database encoding - http://php.vrana.cz/prevod-kodovani-mysql.ph Utilize information_schema.USER_PRIVILEGES in Privileges Highlight SQL textarea - may use external CodePress Column and table names auto-completition in SQL textarea +Mass editation of individual rows ? Save token also to cookie - for session expiration and login in other window ? Save uploaded files after error to session variable instead of hidden field ? Aliasing of built-in functions can save 7 KB, substitution of $_GET and friends can save 2 KB, remove of base64_decode() + using chars 127-255 in minification can save 1 KB, JS packer can save 1 KB
" . htmlspecialchars($name) . "