Re: Mail::Queue put error

From: Date: Fri, 03 Feb 2006 19:35:46 +0000
Subject: Re: Mail::Queue put error
References: 1 2  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-22779@lists.php.net to get a copy of this message
On 2/3/06, Jason Yonk <jason@jmai.net> wrote: > Lorenzo, > > Thanks for getting back to me so quickly! I copied down the files and > uploaded them to the host, and it seemed to take care of the "nextid()" > problem. However, now it's giving me the same error but on "quote()" > (this is being thrown by sendMailsInQueue($max_amount_mails)). I tried > adding PEAR:isError for the $mail_queue variable, but I'm just seeing > the standard error, and not my print statement or anything else. > > What causes the undefined function error? Is it a bad reference in > db.php, or could there be something wrong with my code? How can I go > about debugging this so that I don't have to bother anyone (and learn > the code better)? This is caused by ignoring PEAR_Errors. Some function is returning a PEAR_Error and you're not checking it and using it as if it were a DB. Are you perhaps passing a DB object into Mail_Queue? Check to make sure it's not an error first, as Lorenzo suggested. Another way to do it is to set an error handler: function handlePearError($err) { die($err->getMessage().' '.$err->getUserInfo()); } PEAR::setErrorHandler(PEAR_ERROR_CALLBACK, 'handlePearError'); > > Thanks again! > > J > > -----Original Message----- > From: Lorenzo Alberton [mailto:l.alberton@quipo.it] > Sent: Friday, February 03, 2006 1:17 PM > To: Jason Yonk > Cc: pear-general@lists.php.net > Subject: Re: [PEAR] Mail::Queue put error > > Jason Yonk wrote: > > Seems that trying to call the put function in Mail::Queue is throwing > > the following error in Mail/Queue/Container/db.php. I must've > installed > > something wrong, but can't seem to figure out how/what? > > > > Here's the error: Fatal error: Call to undefined function: nextid() > in > > > /home/virtual/site51/fst/var/www/html/testfolder/Mail/Queue/Container/db > > ..php on line 189 > > > 1) please use the CVS version: > http://cvs.php.net/viewcvs.cgi/pear/Mail_Queue/ > > 2) always check for errors after every method call > > $res = $mq->doSth(); > if (PEAR::isError($res)) { > //uh-oh > } > > > > PS - I tried copying the function from DB/mysql.php into db.php, but I > > still got the same error. > > don't edit the pear files. Unless there are some > serious bugs, this is not necessary. > -- Justin Patrin

« previous php.pear.general (#22779) next »