From bb3f6affeaaf305998675f5f8198feb5739f1590 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Sat, 26 Mar 2011 07:57:02 -0400 Subject: [PATCH] Obey the ShowSQL directive also for inline edit --- js/sql.js | 7 +++++++ sql.php | 4 ++-- tbl_replace.php | 4 +++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/js/sql.js b/js/sql.js index 15c780f2d2..5b0fc083aa 100644 --- a/js/sql.js +++ b/js/sql.js @@ -891,6 +891,13 @@ $(document).ready(function() { $.post('tbl_replace.php', post_params, function(data) { if(data.success == true) { PMA_ajaxShowMessage(data.message); + // remove possible previous feedback message + $('#result_query').remove(); + if (typeof data.result_query != 'undefined') { + // display feedback + $('#sqlqueryresults').prepend('
'); + $('#result_query').prepend(data.result_query); + } PMA_unInlineEditRow($del_hide, $chg_submit, $this_td, $input_siblings, data, disp_mode); } else { PMA_ajaxShowMessage(data.error); diff --git a/sql.php b/sql.php index 50026b92ba..abc1ccf59c 100644 --- a/sql.php +++ b/sql.php @@ -709,8 +709,8 @@ if (0 == $num_rows || $is_affected) { } } - if(isset($GLOBALS['display_query'])) { - $extra_data['sql_query'] = PMA_showMessage(NULL, $GLOBALS['display_query']); + if ($cfg['ShowSQL']) { + $extra_data['result_query'] = PMA_showMessage($message, $GLOBALS['sql_query'], 'success'); } if (isset($GLOBALS['reload']) && $GLOBALS['reload'] == 1) { $extra_data['reload'] = 1; diff --git a/tbl_replace.php b/tbl_replace.php index b15212b470..ab8cd10752 100644 --- a/tbl_replace.php +++ b/tbl_replace.php @@ -326,9 +326,11 @@ if ($is_insert && count($value_sets) > 0) { unset($query_fields); } elseif (empty($query)) { // No change -> move back to the calling script + // + // Note: logic passes here for inline edit $message = PMA_Message::success(__('No change')); $active_page = $goto_include; - if(!$GLOBALS['is_ajax_request'] == true) { + if(! $GLOBALS['is_ajax_request'] == true) { require_once './libraries/header.inc.php'; } require './' . PMA_securePath($goto_include); -- 2.11.4.GIT