Skip to content

Commit

Permalink
Fix phpmyadmin#12534: Remove option from after_field select after a c…
Browse files Browse the repository at this point in the history
…olumn is dropped

Signed-off-by: Deven Bansod <[email protected]>
  • Loading branch information
devenbansod committed Sep 4, 2016
1 parent e803cae commit 2a2d6d8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ phpMyAdmin - ChangeLog
- issue #12502 Remove unused paramenter when connecting to MySQLi
- issue #12303 Fix number formatting with different settings of precision in PHP
- issue #12405 Use single quotes in PHP code
- issue #12534 Option for the dropped column is not removed from 'after_field' select, after the column is dropped

4.6.4 (2016-08-16)
- issue [security] Weaknesses with cookie encryption, see PMASA-2016-29
Expand Down
10 changes: 9 additions & 1 deletion js/tbl_structure.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,16 @@ AJAX.registerOnload('tbl_structure.js', function () {
}
$after_field_item.remove();
$curr_row.hide("medium").remove();
//by default select the last option to add new column (in case last column is dropped)

// Remove the dropped column from select menu for 'after field'
$("select[name=after_field]").find(
'[value="' + curr_column_name.trim() + '"]'
).remove();

// by default select the (new) last option to add new column
// (in case last column is dropped)
$("select[name=after_field] option:last").attr("selected","selected");

//refresh table stats
if (data.tableStat) {
$('#tablestatistics').html(data.tableStat);
Expand Down

0 comments on commit 2a2d6d8

Please sign in to comment.