]> git.joonet.de Git - adminer.git/commitdiff
Select original value
authorjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Tue, 30 Jun 2009 10:27:12 +0000 (10:27 +0000)
committerjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Tue, 30 Jun 2009 10:27:12 +0000 (10:27 +0000)
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@767 7c3ca157-0c34-0410-bff1-cbf682f78f5c

adminer/edit.inc.php
adminer/include/editing.inc.php

index 138bae045c234483c533b5a334d0161ad751ab67..398e5c61298c9f1ceb3c95277ff9be7fe34dcd95 100644 (file)
@@ -67,8 +67,9 @@ if ($fields) {
        echo "<table cellspacing='0'>\n";
        foreach ($fields as $name => $field) {
                echo "<tr><th>" . htmlspecialchars($name) . "</th>";
-               $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])
+               $value = (isset($row)
+                       ? (strlen($row[$name]) && ($field["type"] == "enum" || $field["type"] == "set") ? intval($row[$name]) : $row[$name])
+                       : ($_POST["clone"] && $field["auto_increment"] ? "" : ($where ? $field["default"] : false))
                );
                input($name, $field, $value);
                if (isset($_GET["default"]) && $field["type"] == "timestamp") {
index cca2341391cb83c1d4815028fad752438d494555..88d91c12b2aa47a5921995012778f16e9577f58d 100644 (file)
@@ -43,7 +43,7 @@ function input($name, $field, $value) {
                if ($field["null"] || isset($_GET["default"])) {
                        array_unshift($options, "NULL");
                }
-               echo (count($options) > 1 || isset($_GET["select"]) ? '<select name="function[' . $name . ']">' . (isset($_GET["select"]) ? '<option value="orig">' . lang('original') . '</option>' : '') . optionlist($options, (isset($value) ? (string) $_POST["function"][$name] : null)) . '</select>' : "&nbsp;") . '</td><td>';
+               echo (count($options) > 1 || isset($_GET["select"]) ? '<select name="function[' . $name . ']">' . (isset($_GET["select"]) ? '<option value="orig">' . lang('original') . '</option>' : '') . optionlist($options, ($value === false ? null : (isset($value) ? (string) $_POST["function"][$name] : 'NULL'))) . '</select>' : "&nbsp;") . '</td><td>';
                if ($field["type"] == "set") { //! 64 bits
                        preg_match_all("~'((?:[^']+|'')*)'~", $field["length"], $matches);
                        foreach ($matches[1] as $i => $val) {