The branch, master has been updated via 7d9313245b878bfde8fe4a1ac0d10ba35ac0de79 (commit) from 1059e281d16a3fee98aadded173a8f92b52e2e27 (commit)
- Log ----------------------------------------------------------------- commit 7d9313245b878bfde8fe4a1ac0d10ba35ac0de79 Author: Marc Delisle marc@infomarc.info Date: Sat Dec 25 15:41:37 2010 -0500
rfe #3141330 [relation] When displaying results, show a link to the foreign table even when phpMyAdmin configuration storage is not active
-----------------------------------------------------------------------
Summary of changes: ChangeLog | 2 ++ libraries/display_tbl.lib.php | 32 ++++++++++++++++++-------------- 2 files changed, 20 insertions(+), 14 deletions(-)
diff --git a/ChangeLog b/ChangeLog index a55a6b7..1e7c645 100644 --- a/ChangeLog +++ b/ChangeLog @@ -125,6 +125,8 @@ thanks to garas - garas - bug #3123433 [interface] Avoid double escaping of MySQL errors. - [interface] Use less noisy message and remove disable link on server charts and database statistics. ++ rfe #3141330 [relation] When displaying results, show a link to the foreign + table even when phpMyAdmin configuration storage is not active
3.3.10.0 (not yet released)
diff --git a/libraries/display_tbl.lib.php b/libraries/display_tbl.lib.php index 7bbd4d8..ca56955 100644 --- a/libraries/display_tbl.lib.php +++ b/libraries/display_tbl.lib.php @@ -2014,20 +2014,24 @@ function PMA_displayTable(&$dt_result, &$the_disp_mode, $analyzed_sql) } $tabs = '('' . join('','', $target) . '')';
- if ($cfgRelation['displaywork']) { - if (! strlen($table)) { - $exist_rel = false; - } else { - $exist_rel = PMA_getForeigners($db, $table, '', 'both'); - if ($exist_rel) { - foreach ($exist_rel AS $master_field => $rel) { - $display_field = PMA_getDisplayField($rel['foreign_db'], $rel['foreign_table']); - $map[$master_field] = array($rel['foreign_table'], - $rel['foreign_field'], - $display_field, - $rel['foreign_db']); - } // end while - } // end if + if (! strlen($table)) { + $exist_rel = false; + } else { + // To be able to later display a link to the related table, + // we verify both types of relations: either those that are + // native foreign keys or those defined in the phpMyAdmin + // configuration storage. If no PMA storage, we won't be able + // to use the "column to display" notion (for example show + // the name related to a numeric id). + $exist_rel = PMA_getForeigners($db, $table, '', 'both'); + if ($exist_rel) { + foreach ($exist_rel AS $master_field => $rel) { + $display_field = PMA_getDisplayField($rel['foreign_db'], $rel['foreign_table']); + $map[$master_field] = array($rel['foreign_table'], + $rel['foreign_field'], + $display_field, + $rel['foreign_db']); + } // end while } // end if } // end if // end 2b
hooks/post-receive