Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Display edit form after error in clone or multi-edit

  • Loading branch information...
commit 7da82a12a67021620a0ac3f7cb63f102112be979 1 parent 9567e5c
@vrana authored
View
18 adminer/edit.inc.php
@@ -59,14 +59,6 @@
}
}
-$table_name = $adminer->tableName(table_status1($TABLE, true));
-page_header(
- ($update ? lang('Edit') : lang('Insert')),
- $error,
- array("select" => array($TABLE, $table_name)),
- $table_name
-);
-
$row = null;
if ($_POST["save"]) {
$row = (array) $_POST["fields"];
@@ -118,12 +110,4 @@
}
}
-if ($row === false) {
- echo "<p class='error'>" . lang('No rows.') . "\n";
-}
-?>
-
-<div id="message"></div>
-
-<?php
-edit_form($fields, $row, $update);
+edit_form($TABLE, $fields, $row, $update);
View
16 adminer/include/functions.inc.php
@@ -1249,14 +1249,26 @@ function on_help($command, $side = 0) {
}
/** Print edit data form
+* @param string
* @param array
* @param mixed
* @param bool
* @return null
*/
-function edit_form($fields, $row, $update) {
- global $adminer, $jush, $token;
+function edit_form($TABLE, $fields, $row, $update) {
+ global $adminer, $jush, $token, $error;
+ $table_name = $adminer->tableName(table_status1($TABLE, true));
+ page_header(
+ ($update ? lang('Edit') : lang('Insert')),
+ $error,
+ array("select" => array($TABLE, $table_name)),
+ $table_name
+ );
+ if ($row === false) {
+ echo "<p class='error'>" . lang('No rows.') . "\n";
+ }
?>
+<div id="message"></div>
<form action="" method="post" enctype="multipart/form-data" id="form">
<?php
if (!$fields) {
View
6 adminer/select.inc.php
@@ -139,7 +139,11 @@
}
}
queries_redirect(remove_from_uri($_POST["all"] && $_POST["delete"] ? "page" : ""), $message, $result);
- //! display edit page in case of an error
+ if (!$_POST["delete"]) {
+ edit_form($TABLE, $fields, (array) $_POST["fields"], !$_POST["clone"]);
+ page_footer();
+ exit;
+ }
} elseif (!$_POST["import"]) { // modify
if (!$_POST["val"]) {
View
1  changes.txt
@@ -1,4 +1,5 @@
Adminer 4.0.4-dev:
+Display edit form after error in clone or multi-edit
Display time of the select command
Improve gzip export ratio (bug #387)
MySQL: Fix editing rows by binary values, bug since Adminer 3.7.1
Please sign in to comment.
Something went wrong with that request. Please try again.