Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorWilliam Desportes <williamdes@wdes.fr>2019-11-20 02:46:38 +0300
committerWilliam Desportes <williamdes@wdes.fr>2019-11-20 15:00:32 +0300
commit1de317993fc5ab7712a2eb90ac4c06d0624c740a (patch)
tree431ae693f90fc73263f7b9986dbe7f255224c26b /js
parent642ef8abb5bc1d714c69027be5c026490c88288b (diff)
Fix adding a table from list, do not crash the designer if impossible to add
Signed-off-by: William Desportes <williamdes@wdes.fr>
Diffstat (limited to 'js')
-rw-r--r--js/designer/move.js12
1 files changed, 7 insertions, 5 deletions
diff --git a/js/designer/move.js b/js/designer/move.js
index 367ca4cfa3..8ab76b63cb 100644
--- a/js/designer/move.js
+++ b/js/designer/move.js
@@ -619,13 +619,15 @@ function Add_Other_db_tables () {
}, function (data) {
var $newTableDom = $(data.message);
$newTableDom.find('a').first().remove();
- $('#container-form').append($newTableDom);
- enableTableEvents(null, $newTableDom);
- addTableToTablesList(null, $newTableDom);
var dbEncoded = $($newTableDom).find('.small_tab_pref').attr('db_url');
var tableEncoded = $($newTableDom).find('.small_tab_pref').attr('table_name_url');
- j_tabs[dbEncoded + '.' + tableEncoded] = 1;
- MarkUnsaved();
+ if (typeof dbEncoded === 'string' && typeof tableEncoded === 'string' ) { // Do not try to add if attr not found !
+ $('#container-form').append($newTableDom);
+ enableTableEvents(null, $newTableDom);
+ addTableToTablesList(null, $newTableDom);
+ j_tabs[dbEncoded + '.' + tableEncoded] = 1;
+ MarkUnsaved();
+ }
});
$(this).dialog('close');
};