From ca562232dd3bc87434f8610a57dc6faf9dbdc4cd Mon Sep 17 00:00:00 2001 From: Ashutosh Dhundhara Date: Wed, 16 Apr 2014 17:18:58 +0530 Subject: [PATCH] Bug Fix: #4368 Recent/Favorite tables persist even if they don't exist. Signed-off-by: Ashutosh Dhundhara --- libraries/RecentFavoriteTable.class.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/libraries/RecentFavoriteTable.class.php b/libraries/RecentFavoriteTable.class.php index fd9c70c82c..776ac089ef 100644 --- a/libraries/RecentFavoriteTable.class.php +++ b/libraries/RecentFavoriteTable.class.php @@ -183,6 +183,13 @@ class PMA_RecentFavoriteTable */ public function getHtmlList() { + // Remove Recent/Favorite tables that don't exist. + foreach ($this->tables as $tbl) { + if (! $GLOBALS['dbi']->getColumns($tbl['db'], $tbl['table'])) { + $this->remove($tbl['db'], $tbl['table']); + } + } + $html = ''; if (count($this->tables)) { if ($this->table_type == 'recent') { @@ -263,6 +270,11 @@ class PMA_RecentFavoriteTable */ public function add($db, $table) { + // If table doesnot exist, do not add. + if (! $GLOBALS['dbi']->getColumns($db, $table)) { + return true; + } + $table_arr = array(); $table_arr['db'] = $db; $table_arr['table'] = $table;