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

Bug #17898 sendMailById() causes Fatal Error on nonexistant id
Submitted: 2010-09-27 16:40 UTC
From: hkrems Assigned: till
Status: Closed Package: Mail_Queue (version 1.2.3)
PHP Version: 5.3.2 OS: irrelevant
Roadmaps: 1.2.4    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 12 + 5 = ?

 
 [2010-09-27 16:40 UTC] hkrems (Harald Kremsner)
Description: ------------ sendMailById() calls getMailById(). getMailById() does database search. when id is wrong empty array is returned error handling calls toString() method on array. Fatal Error. Test script: --------------- // setup accorrding to tutorial. // put one mail in queue // set id to value not in table $wrong_id = 2; // use sendMailById() with wrong id sendMailById($wrong_id); Expected result: ---------------- false (like described in documentation) or PEAR_Error object. Actual result: -------------- Fatal error: Call to a member function toString() on a non-object

Comments

 [2010-09-28 16:32 UTC] till (Till Klampaeckel)
-Assigned To: +Assigned To: till -Roadmap Versions: +Roadmap Versions: 1.2.4
 [2010-09-29 18:40 UTC] till (Till Klampaeckel)
Hi, I have to ask you to reconfirm this bug. I just tried with SVN: $queue = new Mail_Queue(..., ...); $status = $queue->sendMailById(1234); $status is a Mail_Queue_Error object. I'm trying to prep a new release. Let me know if SVN fixes your case. Till
 [2010-09-29 18:56 UTC] till (Till Klampaeckel)
I just committed an additional improvement to make the "return" more obvious: http://svn.php.net/viewvc?view=revision&revision=303860
 [2010-09-29 18:56 UTC] till (Till Klampaeckel)
-Status: Assigned +Status: Feedback
 [2010-09-30 03:15 UTC] till (Till Klampaeckel)
-Status: Feedback +Status: Closed
This bug has been fixed in SVN. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.