From d66d506e5844b6253e8e18f2e03dc6f5c19a6698 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Tue, 15 Oct 2013 11:42:49 +0000 Subject: [PATCH] fixed broken install under PostgreSQL caused by PHP Fatal error: Call to a member function fetch() on a non-object --- phpgwapi/inc/class.accounts_sql.inc.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/phpgwapi/inc/class.accounts_sql.inc.php b/phpgwapi/inc/class.accounts_sql.inc.php index 14e2381682..c50bedbf42 100644 --- a/phpgwapi/inc/class.accounts_sql.inc.php +++ b/phpgwapi/inc/class.accounts_sql.inc.php @@ -466,8 +466,11 @@ class accounts_sql ($table == $this->contacts_table ? " AND contact_tid != 'D'" : ''); // ignore deleted accounts contact-data } - if (!($row = $this->db->select($table,$cols,$where,__LINE__,__FILE__)->fetch())) return false; - + if (!($rs = $this->db->select($table,$cols,$where,__LINE__,__FILE__)) || !($row = $rs->fetch())) + { + error_log(__METHOD__."('$name', '$which', ".array2string($account_type).") db->select('$table', '$cols', ".array2string($where).") returned ".array2string($rs).' '.function_backtrace()); + return false; + } return ($row['account_type'] == 'g' ? -1 : 1) * $row['account_id']; }