bugs 1005414 and 1004546

This commit is contained in:
Marc Delisle
2004-08-08 11:21:05 +00:00
parent d88c792995
commit 160e4e29bc
2 changed files with 22 additions and 8 deletions

View File

@@ -5,6 +5,11 @@ phpMyAdmin - Changelog
$Id$
$Source$
2004-08-08 Marc Delisle <lem9@users.sourceforge.net>
* 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ř <michal@cihar.com>
* calendar.php: Include correct stylesheet (bug #1005421).

View File

@@ -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 the display field has been defined for the foreign table
if ($foreign_display) {
if (PMA_strlen($relrow[$foreign_display]) <= $cfg['LimitChars']) {
$value = (($foreign_display != FALSE) ? htmlspecialchars($relrow[$foreign_display]) : '');
$value = htmlspecialchars($relrow[$foreign_display]);
$vtitle = '';
} else {
$vtitle = htmlspecialchars($relrow[$foreign_display]);
$value = (($foreign_display != FALSE) ? htmlspecialchars(substr($vtitle, 0, $cfg['LimitChars']) . '...') : '');
$value = htmlspecialchars(substr($vtitle, 0, $cfg['LimitChars']) . '...');
}
} else {
$vtitle = $value = '';
} // end if ($foreign_display)
$reloption = '<option value="' . htmlspecialchars($key) . '"';
if ($vtitle != '') {
@@ -647,6 +653,9 @@ function PMA_foreignDropdown($disp, $foreign_field, $foreign_display, $data, $ma
$reloptions['content-id'][] = $reloption . '>' . htmlspecialchars($key) . '&nbsp;-&nbsp;' . $value . '</option>' . "\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) {