bug #3072492 Error for wrong SQL disappears

This commit is contained in:
Marc Delisle
2010-10-08 06:23:27 -04:00
parent 2845fbb451
commit fe5577568d
2 changed files with 6 additions and 2 deletions

View File

@@ -184,6 +184,9 @@ $(document).ready(function() {
*/ */
$("#sqlqueryform").live('submit', function(event) { $("#sqlqueryform").live('submit', function(event) {
event.preventDefault(); event.preventDefault();
// remove any div containing a previous error message
$('.error').remove();
$form = $(this); $form = $(this);
PMA_ajaxShowMessage(); PMA_ajaxShowMessage();
@@ -206,7 +209,8 @@ $(document).ready(function() {
} }
} }
else if (data.success == false ) { else if (data.success == false ) {
PMA_ajaxShowMessage(data.error, 50000); // show an error message that stays on screen
$('#sqlqueryform').before(data.error);
} }
else { else {
$("#sqlqueryresults").html(data); $("#sqlqueryresults").html(data);

View File

@@ -377,7 +377,7 @@ if (isset($GLOBALS['show_as_php']) || !empty($GLOBALS['validatequery'])) {
$table = ''; $table = '';
} }
$active_page = $goto; $active_page = $goto;
$message = htmlspecialchars(PMA_Message::rawError($error)); $message = PMA_Message::rawError(htmlspecialchars($error));
if( $GLOBALS['is_ajax_request'] == true) { if( $GLOBALS['is_ajax_request'] == true) {
PMA_ajaxResponse($message, false); PMA_ajaxResponse($message, false);