Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.2.7

Bug #9219 sendMailsInQueue does not return an ErrorObject
Submitted: 2006-11-02 16:55 UTC
From: ericbouwers at gmail dot com Assigned: quipo
Status: Closed Package: Mail_Queue (version 1.1.3)
PHP Version: Irrelevant OS: Windows / Linux
Roadmaps: (Not assigned)    
Subscription  


 [2006-11-02 16:55 UTC] ericbouwers at gmail dot com (Eric Bouwers)
Description: ------------ The 'sendMailsInQueue' function in the 'Mail_Queue' will always return true. There is a call to 'PEAR::raiseError', but the result of this call is not returned. I have found: http://pear.php.net/bugs/bug.php?id=147 which explains the solution and this: 'If someone finds the time to propose a patch with an even better solution, he's welcome.' I have written down a proposal as a probable fix. This will return 'true' when everything succeeds and the latest error otherwise. Test script: --------------- Script: --- $status = $mail_queue->sendMailsInQueue($max_ammount_mails); if(PEAR::isError($status)){ echo 'Mails are not send'; } else { echo 'Mails are send'; } --- Probable fix: Add an return on line 320. === while ($mail = $this->get()) { $this->container->countSend($mail); $result = $this->sendMail($mail); if (!PEAR::isError($result)) { //if-case } else { PEAR::raiseError(/* ..options.. */); } } return true; === becomes: === $status = true; while ($mail = $this->get()) { $this->container->countSend($mail); $result = $this->sendMail($mail); if (!PEAR::isError($result)) { //if-case } else { $status = PEAR::raiseError(/* ..options.. */); } } return $status; === Expected result: ---------------- 'There was a problem' Actual result: -------------- There is an infinite loop. (see http://pear.php.net/bugs/bug.php?id=6538) But according to the code the result would be: 'Mails are send'

Comments

 [2006-11-02 16:57 UTC] ericbouwers at gmail dot com
Entered wrong email-address
 [2007-01-20 11:25 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!