Bug #16609 [Ana]: Call to undefined method

From: Date: Wed, 16 Sep 2009 05:45:31 +0000
Subject: Bug #16609 [Ana]: Call to undefined method
References: 1  Groups: php.pear.bugs 
Request: Send a blank email to pear-bugs+get-1643@lists.php.net to get a copy of this message
Edit report at http://pear.php.net/bugs/bug.php?id=16609&edit=1 ID: 16609 Updated by: mick@deafzone.ch Reported By: mick at deafzone dot ch Summary: Call to undefined method Status: Analyzed Type: Bug Package: Mail_Queue Package Version: 1.2.3 PHP Version: 5.3.0 Assigned To: till Roadmap Versions: New Comment: Thank you for all this but I've been working nonstop since yesterday, switching all my code to MDB2. And now the I found a new bug in the package when calling getQueueCount: MESSAGE: Undefined variable: row TYPE: Notice FILE: xxx/httpdocs/r/php/lib/pear/Mail/Queue/Container/mdb2.php LINE: 414 DEBUG INFO: 406 if (PEAR::isError($res)) { 407 return $res; 408 } 409 $query = 'SELECT count(*) FROM ' . $this->mail_table; 410 $count = $this->db->queryOne($query); 411 if (PEAR::isError($count)) { 412 return new Mail_Queue_Error(MAILQUEUE_ERROR_QUERY_FAILED, 413 $this->pearErrorMode, E_USER_ERROR, __FILE__, __LINE__, 414 'MDB2: query failed - "'.$query.'" - '.$row->getMessage()); 415 } 416 return (int) $count; 417 } 418 419 // }}} 420 // {{{ deleteMail() 421 422 /** Previous Comments: ------------------------------------------------------------------------ [2009-09-16 02:43:45] doconnor Ah, it's cut and paste from Request #15049 MDB2's version, which should be easy to translate // {{{ _checkConnection() /** * Check if there's a valid db connection * * @return boolean|PEAR_Error on error */ function _checkConnection() { if (!is_object($this->db) || !is_a($this->db, 'MDB2_Driver_Common')) { $msg = 'MDB2::connect failed'; if (PEAR::isError($this->db)) { $msg .= ': '.$this->db->getMessage(); } return new Mail_Queue_Error(MAILQUEUE_ERROR_CANNOT_CONNECT, $this->pearErrorMode, E_USER_ERROR, __FILE__, __LINE__, $msg); } return true; } ------------------------------------------------------------------------ [2009-09-16 02:42:08] doconnor This got added in: Revision: 283110 Author: till Date: 8:09:59 PM, Tuesday, June 30, 2009 Message: * implemented getQueueCount() in db container (#15049) ---- Modified : /pear/packages/Mail_Queue/trunk/Queue/Container/db.php ... but _checkConnection() didn't make it. ------------------------------------------------------------------------ [2009-09-15 12:28:42] till -Status: Open +Status: Analyzed -Assigned To: +Assigned To: till Hi, we deprecated DB support, and DB itself has been deprecated for a long, long while. I suggest you switch to MDB2. Let me know, Till ------------------------------------------------------------------------ [2009-09-15 03:41:22] mick Description: ------------ Hi Sorry, but there is a bad bug, see line 367 in the container class db.php, there the method _checkConnection is called but it does not exist! Thanks for fixing it asap. Cheers Michael Actual result: -------------- [15-Sep-2009 03:30:01] PHP Fatal error: Call to undefined method Mail_Queue_Container_db::_checkConnection() in /home/httpd/vhosts/deafzone.ch/httpdocs/r/php/lib/pear/Mail/Queue/Container/db.php on line 367 ------------------------------------------------------------------------ -- Edit this bug report at http://pear.php.net/bugs/bug.php?id=16609&edit=1

« previous php.pear.bugs (#1643) next »