diff --git a/ChangeLog b/ChangeLog index ada4cecf5..80a37c51b 100755 --- a/ChangeLog +++ b/ChangeLog @@ -5,8 +5,13 @@ phpMyAdmin - Changelog $Id$ $Source$ +2004-08-08 Marc Delisle + * libraries/relation.lib.php: bug 1005414, undefined offset when + no display field has been defined; bug 1004546, sort error in dropdown + list of foreign values; incorrect result was freed + 2004-08-08 Michal Čihař - * calendar.php: Include correct stylesheet (bug #1005421). + * calendar.php: Include correct stylesheet (bug #1005421). 2004-08-07 Marc Delisle * lang/turkish update, thanks to Bora Alioglu diff --git a/libraries/relation.lib.php b/libraries/relation.lib.php index d474b0aa1..619add34c 100644 --- a/libraries/relation.lib.php +++ b/libraries/relation.lib.php @@ -483,7 +483,7 @@ function PMA_setComment($db, $table, $key, $value, $removekey = '') { if ($test_rs && PMA_DBI_num_rows($test_rs) > 0) { $row = PMA_DBI_fetch_assoc($test_rs); - PMA_DBI_free_result($res); + PMA_DBI_free_result($test_rs); if (strlen($value) > 0 || strlen($row['mimetype']) > 0 || strlen($row['transformation']) > 0 || strlen($row['transformation_options']) > 0) { $upd_query = 'UPDATE ' . PMA_backquote($cfgRelation['column_info']) @@ -626,13 +626,19 @@ function PMA_foreignDropdown($disp, $foreign_field, $foreign_display, $data, $ma foreach ($disp AS $disp_key => $relrow) { $key = $relrow[$foreign_field]; - if (PMA_strlen($relrow[$foreign_display]) <= $cfg['LimitChars']) { - $value = (($foreign_display != FALSE) ? htmlspecialchars($relrow[$foreign_display]) : ''); - $vtitle = ''; + + // if the display field has been defined for the foreign table + if ($foreign_display) { + if (PMA_strlen($relrow[$foreign_display]) <= $cfg['LimitChars']) { + $value = htmlspecialchars($relrow[$foreign_display]); + $vtitle = ''; + } else { + $vtitle = htmlspecialchars($relrow[$foreign_display]); + $value = htmlspecialchars(substr($vtitle, 0, $cfg['LimitChars']) . '...'); + } } else { - $vtitle = htmlspecialchars($relrow[$foreign_display]); - $value = (($foreign_display != FALSE) ? htmlspecialchars(substr($vtitle, 0, $cfg['LimitChars']) . '...') : ''); - } + $vtitle = $value = ''; + } // end if ($foreign_display) $reloption = '' . "\n"; } // end while + // the list of keys looks better if not sorted by description + asort($reloptions['content-id']); + if ($max == -1 || count($reloptions['content-id']) < $max) { $ret .= implode('', $reloptions['content-id']); if (count($reloptions['content-id']) > 0) {