diff --git a/ChangeLog b/ChangeLog index 69629b6a5..29f12bbf0 100755 --- a/ChangeLog +++ b/ChangeLog @@ -13,6 +13,8 @@ $Source$ * lang/czech: Update. * tbl_relation.php: Backquote table name (bug #1050441). * db_details_qbe.php: Backquote table name. + * libraries/display_tbl.lib.php: Comments now work for multi table selects + (bug #789647). 2004-10-19 Marc Delisle * libraries/database_interface.lib.php: bug #1041667, correctly diff --git a/libraries/display_tbl.lib.php b/libraries/display_tbl.lib.php index 588ac665b..d9772a016 100644 --- a/libraries/display_tbl.lib.php +++ b/libraries/display_tbl.lib.php @@ -690,9 +690,13 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $ // 2.0.1 Prepare Display column comments if enabled ($cfg['ShowBrowseComments']). // Do not show comments, if using horizontalflipped mode, because of space usage if ($GLOBALS['cfg']['ShowBrowseComments'] && $GLOBALS['cfgRelation']['commwork'] && $disp_direction != 'horizontalflipped') { - $comments_map = PMA_getComments($db, $table); - } else { $comments_map = array(); + foreach ($analyzed_sql[0]['table_ref'] as $tbl) { + + $tb = $tbl['table_true_name']; + + $comments_map[$tb] = PMA_getComments($db, $tb); + } } if ($GLOBALS['cfgRelation']['commwork'] && $GLOBALS['cfgRelation']['mimework'] && $GLOBALS['cfg']['BrowseMIME']) { @@ -732,11 +736,13 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $ } // 2.0 Prepare comment-HTML-wrappers for each row, if defined/enabled. - if (isset($comments_map[$fields_meta[$i]->name])) { + if (isset($comments_map) && + isset($comments_map[$fields_meta[$i]->table]) && + isset($comments_map[$fields_meta[$i]->table][$fields_meta[$i]->name])) { /*$comments_table_wrap_pre = '
'; $comments_table_wrap_post = '
' . htmlspecialchars($comments_map[$fields_meta[$i]->name]) . '
';*/ $comments_table_wrap_pre = ''; - $comments_table_wrap_post = '' . htmlspecialchars($comments_map[$fields_meta[$i]->name]) . ''; + $comments_table_wrap_post = '' . htmlspecialchars($comments_map[$fields_meta[$i]->table][$fields_meta[$i]->name]) . ''; } else { $comments_table_wrap_pre = ''; $comments_table_wrap_post = '';