diff --git a/ChangeLog b/ChangeLog index 80aa32ffeb..b7c362d9f3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -45,6 +45,7 @@ phpMyAdmin - ChangeLog + rfe #1672 MIME types should be lower case 4.4.9.0 (not yet released) +- bug #4920 relation view doesn't list fields of table in other database 4.4.8.0 (2015-05-28) - bug Allow accessing visual query builder when pmadb is not configured diff --git a/js/tbl_relation.js b/js/tbl_relation.js index fd35443d40..f3de08295c 100644 --- a/js/tbl_relation.js +++ b/js/tbl_relation.js @@ -39,10 +39,12 @@ function getDropdownValues($dropdown) { var foreign = ''; // if the changed dropdown is for foreign key constraints if ($dropdown.is('select[name^="destination_foreign"]')) { + $databaseDd = $dropdown.parent().parent().parent().find('select[name^="destination_foreign_db"]'); $tableDd = $dropdown.parent().parent().parent().find('select[name^="destination_foreign_table"]'); $columnDd = $dropdown.parent().parent().parent().find('select[name^="destination_foreign_column"]'); foreign = '_foreign'; } else { // internal relations + $databaseDd = $dropdown.parent().find('select[name^="destination_db"]'); $tableDd = $dropdown.parent().find('select[name^="destination_table"]'); $columnDd = $dropdown.parent().find('select[name^="destination_column"]'); } @@ -57,8 +59,7 @@ function getDropdownValues($dropdown) { return; } } else { // if a table selector - foreignDb = $dropdown.parent().parent().parent() - .find('select[name^="destination' + foreign + '_db"]').val(); + foreignDb = $databaseDd.val(); foreignTable = $dropdown.val(); // if no table is selected empty the column dropdown if (foreignTable === '') {