Skip to content

Commit

Permalink
Adjust adding table key operations to use POST
Browse files Browse the repository at this point in the history
Issue phpmyadmin#13866

Signed-off-by: Michal Čihař <michal@cihar.com>
  • Loading branch information
nijel committed Dec 15, 2017
1 parent 8332861 commit 6ee2f12
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
11 changes: 6 additions & 5 deletions js/tbl_structure.js
Expand Up @@ -304,13 +304,14 @@ AJAX.registerOnload('tbl_structure.js', function () {
var question = PMA_sprintf(PMA_messages.strDoYouReally, 'ALTER TABLE `' +
escapeHtml(curr_table_name) + '` ' + add_clause + '(`' + escapeHtml(curr_column_name) + '`);');

$(this).PMA_confirm(question, $(this).attr('href'), function (url) {
var $this_anchor = $(this);

$this_anchor.PMA_confirm(question, $this_anchor.attr('href'), function (url) {
PMA_ajaxShowMessage();
AJAX.source = $this;
var params = {
'ajax_request' : true,
'ajax_page_request' : true
};

var params = getJSConfirmCommonParam(this, $this_anchor.attr('data-post'));
params += '&ajax_page_request=1';
$.post(url, params, AJAX.responseHandler);
}); // end $.PMA_confirm()
}); // end Add key
Expand Down
Expand Up @@ -14,7 +14,7 @@
add_unique_anchor
{%- elseif action == 'Spatial' %}
add_spatial_anchor
{%- endif %}" href="tbl_structure.php{{ url_query|raw -}}
{%- endif %}" href="tbl_structure.php" data-post="{{ url_query|raw -}}
&amp;add_key=1&amp;sql_query=
{{- ('ALTER TABLE ' ~
Util_backquote(table) ~
Expand Down
4 changes: 2 additions & 2 deletions templates/table/structure/actions_in_table_structure.twig
Expand Up @@ -90,8 +90,8 @@
or tbl_storage_engine == 'MARIA'
or (tbl_storage_engine == 'INNODB' and mysql_int_version >= 50604)
) and ('text' in type or 'char' in type) %}
<a rel="samepage" class="ajax add_key add_fulltext_anchor" href="tbl_structure.php
{{- url_query|raw }}&amp;add_key=1&amp;sql_query=
<a rel="samepage" class="ajax add_key add_fulltext_anchor" href="tbl_structure.php"
data-post="{{- url_query|raw }}&amp;add_key=1&amp;sql_query=
{{- ('ALTER TABLE ' ~ Util_backquote(table)
~ ' ADD FULLTEXT(' ~ Util_backquote(row['Field'])
~ ');')|url_encode }}&amp;message_to_show=
Expand Down

0 comments on commit 6ee2f12

Please sign in to comment.