Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Bug #3838 Modifying a column does not show the result of the operation

  • Loading branch information...
commit fc35b6c8ce8f71da19597bb86585165580cdfc6b 1 parent 9158580
@lem9 lem9 authored
View
28 libraries/structure.lib.php
@@ -2381,6 +2381,7 @@ function PMA_updateColumns($db, $table)
$sql_query .= ';';
$result = PMA_DBI_try_query($sql_query);
+ $response = PMA_Response::getInstance();
if ($result !== false) {
$message = PMA_Message::success(
__('Table %1$s has been altered successfully')
@@ -2424,26 +2425,15 @@ function PMA_updateColumns($db, $table)
}
}
- $response = PMA_Response::getInstance();
- if ($response->isAjax()) {
- $response->isSuccess($message->isSuccess());
- $response->addJSON('message', $message);
- $response->addJSON(
- 'sql_query',
- PMA_Util::getMessage(null, $sql_query)
- );
- }
+ $response->addHTML(
+ PMA_Util::getMessage($message, $sql_query, 'success')
+ );
} else {
- PMA_Util::mysqlDie('', '', '', $err_url, false);
- // An error happened while inserting/updating a table definition.
- // to prevent total loss of that data, we embed the form once again.
- // The variable $regenerate will be used to restore data in
- // libraries/tbl_columns_definition_form.inc.php
- // @todo: test this code, now that it's inside a function
- if (isset($_REQUEST['orig_field'])) {
- $_REQUEST['field'] = $_REQUEST['orig_field'];
- }
-
+ // An error happened while inserting/updating a table definition
+ $message = PMA_Message::rawError(__('Query error'));
+ $response->addHTML(
+ PMA_Util::getMessage($message, $sql_query, 'error')
+ );
$regenerate = true;
}
return $regenerate;
View
4 tbl_addfield.php
@@ -41,6 +41,10 @@
}
if (isset($_REQUEST['do_save_data'])) {
+ //avoid an incorrect calling of PMA_updateColumns() via
+ //tbl_structure.php below
+ unset($_REQUEST['do_save_data']);
+
$query = '';
$definitions = array();
View
4 tbl_structure.php
@@ -48,8 +48,8 @@
if (isset($_REQUEST['do_save_data'])) {
$regenerate = PMA_updateColumns($db, $table);
if ($regenerate) {
- // @todo: find in which situation this happens, then
- // do something appropriate
+ // This happens when updating failed
+ // @todo: do something appropriate
} else {
// continue to show the table's structure
unset($_REQUEST['selected']);
Please sign in to comment.
Something went wrong with that request. Please try again.