diff --git a/ChangeLog b/ChangeLog index 2a846a4e7..ea93c6bd3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -8,6 +8,8 @@ $HeadURL$ 2006-11-26 Marc Delisle * tbl_structure.php: bug #1602335, browse distinct values and name containing a quote + * libraries/bookmark.lib.php: bug #1579701: error listing bookmarks + when dropping a table and no pmadb 2006-11-24 Marc Delisle * tbl_change.php, Documentation.html: users can now toggle the display diff --git a/libraries/bookmark.lib.php b/libraries/bookmark.lib.php index 4c9278bb1..66c0e2e68 100644 --- a/libraries/bookmark.lib.php +++ b/libraries/bookmark.lib.php @@ -51,6 +51,10 @@ function PMA_listBookmarks($db, $cfgBookmark) { global $controllink; + if (empty($cfgBookmark['db']) || empty($cfgBookmark['table'])) { + return ''; + } + $query = 'SELECT label, id FROM '. PMA_backquote($cfgBookmark['db']) . '.' . PMA_backquote($cfgBookmark['table']) . ' WHERE dbase = \'' . PMA_sqlAddslashes($db) . '\'' . ' AND (user = \'' . PMA_sqlAddslashes($cfgBookmark['user']) . '\'' @@ -203,6 +207,16 @@ function PMA_deleteBookmarks($db, $cfgBookmark, $id) /** * Bookmark Support */ -$cfg['Bookmark'] = PMA_getBookmarksParam(); + +if (! isset($GLOBALS['cfgRelation'])) { + require_once './libraries/relation.lib.php'; + $GLOBALS['cfgRelation'] = PMA_getRelationsParam(); +} + +if ($GLOBALS['cfgRelation']['bookmarkwork']) { + $cfg['Bookmark'] = PMA_getBookmarksParam(); +} else { + $cfg['Bookmark'] = array(); +} ?>