Merge branch 'QA_5_2'

This commit is contained in:
William Desportes 2023-11-12 17:34:41 +01:00
commit 083fdd8568
No known key found for this signature in database
GPG Key ID: 90A0EF1B8251A889
2 changed files with 22 additions and 11 deletions

View File

@ -69,6 +69,9 @@ phpMyAdmin - ChangeLog
- issue #18650 Fixed double escaping on foreign key relation link title
- issue #18533 Fixed wrong count for simulated queries
- issue #18611 Fixed an error when searching a table without conditions
- issue #17381 Fixed JS errors when editing indexes on create table
- issue #14402 Fix the PRIMARY label still shown when using two columns for a PK on create table
- issue #17347 Fixed JS errors when changing index settings on create table
5.2.1 (2023-02-07)
- issue #17522 Fix case where the routes cache file is invalid

View File

@ -111,17 +111,21 @@ function removeColumnFromIndex (colIndex): void {
return;
}
// Remove column from index array.
var sourceLength = sourceArray[previousIndexes[1]].columns.length;
for (var i = 0; i < sourceLength; i++) {
if (sourceArray[previousIndexes[1]].columns[i].col_index === colIndex) {
sourceArray[previousIndexes[1]].columns.splice(i, 1);
if (previousIndex[1] in sourceArray) {
// Remove column from index array.
var sourceLength = sourceArray[previousIndexes[1]].columns.length;
for (var i = 0; i < sourceLength; i++) {
if (i in sourceArray[previousIndex[1]].columns) {
if (sourceArray[previousIndexes[1]].columns[i].col_index === colIndex) {
sourceArray[previousIndexes[1]].columns.splice(i, 1);
}
}
}
}
// Remove index completely if no columns left.
if (sourceArray[previousIndexes[1]].columns.length === 0) {
sourceArray.splice(previousIndexes[1], 1);
// Remove index completely if no columns left.
if (sourceArray[previousIndexes[1]].columns.length === 0) {
sourceArray.splice(previousIndexes[1], 1);
}
}
// Update current index details.
@ -709,7 +713,7 @@ function on () {
if (indexChoice === 'none') {
Indexes.removeColumnFromIndex(colIndex);
var id = 'index_name_' + '0' + '_8';
var id = 'index_name_' + colIndex + '_8';
var $name = $('#' + id);
if ($name.length === 0) {
$name = $('<a id="' + id + '" href="#" class="ajax show_index_dialog"></a>');
@ -764,7 +768,11 @@ function on () {
var arrayIndex = previousIndex[1];
var sourceArray = Indexes.getIndexArray(indexChoice);
if (sourceArray !== null) {
if (sourceArray === null) {
return;
}
if (arrayIndex in sourceArray) {
var sourceLength = sourceArray[arrayIndex].columns.length;
var targetColumns = [];