diff options
author | William Desportes <williamdes@wdes.fr> | 2021-03-24 05:21:49 +0300 |
---|---|---|
committer | William Desportes <williamdes@wdes.fr> | 2021-03-24 05:22:25 +0300 |
commit | e76c181d8736828f2260d9593862d491690b36bd (patch) | |
tree | aa240bec8fa8f92a0e0c3acca490faa9370861bd /libraries/classes/Table.php | |
parent | d4d61b78d5c748b5c81cf780730e1eefe5099d87 (diff) | |
parent | 2ece069cf6b32f3431189e0d3149c4738df042e5 (diff) |
Merge branch 'QA_5_1'
Signed-off-by: William Desportes <williamdes@wdes.fr>
Diffstat (limited to 'libraries/classes/Table.php')
-rw-r--r-- | libraries/classes/Table.php | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libraries/classes/Table.php b/libraries/classes/Table.php index 9528271bc7..57546ecebb 100644 --- a/libraries/classes/Table.php +++ b/libraries/classes/Table.php @@ -2274,12 +2274,13 @@ class Table // Drops the old index if (! empty($_POST['old_index'])) { - if ($_POST['old_index'] === 'PRIMARY') { + $oldIndex = is_array($_POST['old_index']) ? $_POST['old_index']['Key_name'] : $_POST['old_index']; + if ($oldIndex === 'PRIMARY') { $sql_query .= ' DROP PRIMARY KEY,'; } else { $sql_query .= sprintf( ' DROP INDEX %s,', - Util::backquote($_POST['old_index']) + Util::backquote($oldIndex) ); } } |