From ce571e0fd0fcaff2bd8fef5ad2f5c8355064857a Mon Sep 17 00:00:00 2001 From: Jonathan Byrne Date: Fri, 16 Nov 2007 09:17:41 +0000 Subject: [PATCH] KTS-2505 "Database configuration issues cause horrible knowledgetree failure" --- search2/search/search.inc.php | 8 ++++++++ 1 file changed, 8 insertions(+), 0 deletions(-) diff --git a/search2/search/search.inc.php b/search2/search/search.inc.php index 4ae5136..651f817 100755 --- a/search2/search/search.inc.php +++ b/search2/search/search.inc.php @@ -263,6 +263,14 @@ class SearchHelper public static function getSavedSearches($userID) { + + // need to test for broken db configuration so that the queries dont fail + // and so that we can be redirected to the db error page + // TODO: maybe best to have a special db error page rather than the default template when logged in + + global $default; + if (is_null($default->_db) || PEAR::isError($default->_db)) return array(); + $sql = "SELECT id, name FROM search_saved WHERE type='S'"; // if we are not the system admin, then we get only ours or shared searches -- libgit2 0.21.4