Skip to content

Commit

Permalink
Merge branch 'QA_4_8'
Browse files Browse the repository at this point in the history
[ci skip]
Signed-off-by: William Desportes <williamdes@wdes.fr>
  • Loading branch information
williamdes committed Apr 28, 2019
2 parents 1524ec5 + 14e8d5d commit c6d8fb4
Show file tree
Hide file tree
Showing 6 changed files with 303 additions and 223 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
Expand Up @@ -109,6 +109,10 @@ phpMyAdmin - ChangeLog
- issue #14908 Fixed uninterpreted HTML on Settings->Import (missing data error descriptions)
- issue #14800 Fixed status->Processes doesn't show full query process list page
- issue #14833 Fixed sort by Time not working in process list page
- issue #14982 Fixed setting "null" keep an "enum" value
- issue #14401 Fixed insert rows keypress Enter behavior
- issue #15146 Fixed error reports can not be sent because they are too large
- issue #15205 Fixed useless backquotes on sql preview modal when deleting an index

4.8.5 (2019-01-25)
- issue Developer debug data was saved to the PHP error log
Expand Down
14 changes: 13 additions & 1 deletion js/error_report.js
Expand Up @@ -208,6 +208,18 @@ var ErrorReport = {
* @return object
*/
_get_report_data: function (exception) {
if (exception && exception.stack && exception.stack.length) {
for (var i = 0; i < exception.stack.length; i++) {
var stack = exception.stack[i];
if (stack.context && stack.context.length) {
for (var j = 0; j < stack.context.length; j++) {
if (stack.context[j].length > 180) {
stack.context[j] = stack.context[j].substring(-1, 180);
}
}
}
}
}
var report_data = {
'server': PMA_commonParams.get('server'),
'ajax_request': true,
Expand All @@ -218,7 +230,7 @@ var ErrorReport = {
if (AJAX.scriptHandler._scripts.length > 0) {
report_data.scripts = AJAX.scriptHandler._scripts.map(
function (script) {
return script.name;
return script;
}
);
}
Expand Down
52 changes: 52 additions & 0 deletions js/functions.js
Expand Up @@ -2423,6 +2423,58 @@ function PMA_previewSQL ($form) {
});
}

/**
* Callback called when submit/"OK" is clicked on sql preview/confirm modal
*
* @callback onSubmitCallback
* @param {string} url The url
*/

/**
*
* @param {string} sql_data Sql query to preview
* @param {string} url Url to be sent to callback
* @param {onSubmitCallback} callback On submit callback function
*
* @return void
*/
function PMA_confirmPreviewSQL (sql_data, url, callback) {
var $dialog_content = $('<div class="preview_sql"><code class="sql"><pre>'
+ sql_data
+ '</pre></code></div>'
);
var button_options = [
{
text: PMA_messages.strOK,
class: 'submitOK',
click: function () {
callback(url);
}
},
{
text: PMA_messages.strCancel,
class: 'submitCancel',
click: function () {
$(this).dialog('close');
}
}
];
var $response_dialog = $dialog_content.dialog({
minWidth: 550,
maxHeight: 400,
modal: true,
buttons: button_options,
title: PMA_messages.strPreviewSQL,
close: function () {
$(this).remove();
},
open: function () {
// Pretty SQL printing.
PMA_highlightSQL($(this));
}
});
}

/**
* check for reserved keyword column name
*
Expand Down
2 changes: 1 addition & 1 deletion js/indexes.js
Expand Up @@ -636,7 +636,7 @@ AJAX.registerOnload('indexes.js', function () {
.val()
);

$anchor.PMA_confirm(question, $anchor.attr('href'), function (url) {
PMA_confirmPreviewSQL(question, $anchor.attr('href'), function (url) {
var $msg = PMA_ajaxShowMessage(PMA_messages.strDroppingPrimaryKeyIndex, false);
var params = getJSConfirmCommonParam(this, $anchor.getPostData());
$.post(url, params, function (data) {
Expand Down

0 comments on commit c6d8fb4

Please sign in to comment.