Merge pull request #1651 from smita786/QA_4_4

fix bug #4857
This commit is contained in:
Smita Kumari 2015-04-17 17:35:34 +05:30
commit fff9acba4e
3 changed files with 15 additions and 6 deletions

View File

@ -11,6 +11,7 @@ phpMyAdmin - ChangeLog
- bug PHP 7 compatibility in php-gettext
- bug PHP 7 compatibility in bfShapeFiles
- bug PHP 7 session_regenerate_id() warning
- bug #4857 Alter table after changing column name error
4.4.2.0 (2015-04-13)
- bug #4835 PMA_hideShowConnection not called after submit_num_fields

View File

@ -92,9 +92,6 @@ AJAX.registerOnload('tbl_structure.js', function () {
indexes = [];
fulltext_indexes = [];
//by default select the last option to add new column (adds at end of the table)
$("select[name=after_field] option:last").attr("selected","selected");
/**
*Ajax action for submitting the "Column Change" and "Add Column" form
*/

View File

@ -1704,10 +1704,21 @@ function PMA_getHtmlForAddColumn($columns_list)
. 'value="first" data-pos = "first">'
. __('at beginning of table')
. '</option>';
$cols_count = count($columns_list);
foreach ($columns_list as $one_column_name) {
$column_selector .= '<option '
. 'value="' . htmlspecialchars($one_column_name) . '">'
. sprintf(__('after %s'), htmlspecialchars($one_column_name))
//by default select the last column (add column at the end of the table)
if (--$cols_count == 0) {
$column_selector .= '<option '
. 'value="' . htmlspecialchars($one_column_name)
. '" selected="selected">';
} else {
$column_selector .= '<option '
. 'value="' . htmlspecialchars($one_column_name) . '">';
}
$column_selector .= sprintf(
__('after %s'),
htmlspecialchars($one_column_name)
)
. '</option>';
}
$column_selector .= '</select>';