6.0.0-beta1
7/24/25

[#4744] php dying on IMP::status() call on line 56 of templates/compose/compose.inc
Summary php dying on IMP::status() call on line 56 of templates/compose/compose.inc
Queue Horde Framework Packages
Queue Version HEAD
Type Bug
State Resolved
Priority 1. Low
Owners chuck (at) horde (dot) org
Requester cbs (at) cts (dot) ucla (dot) edu
Created 12/07/2006 (6804 days ago)
Due
Updated 12/07/2006 (6804 days ago)
Assigned 12/07/2006 (6804 days ago)
Resolved 12/07/2006 (6804 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
12/07/2006 10:37:11 PM Chuck Hagenbuch Comment #9
State ⇒ Resolved
Reply to this comment
Okay, should really be handled now. Let me know if you run into 
anything else - thanks!



(this is the change to HEAD for reference - exact same diff on FW_3:) 
http://cvs.horde.org/diff.php/framework/Notification/Notification/Listener.php?r1=1.23&r2=1.24&ty=u
12/07/2006 09:08:47 PM Chuck Hagenbuch Assigned to Chuck Hagenbuch
State ⇒ Assigned
 
12/07/2006 08:20:15 PM cbs (at) cts (dot) ucla (dot) edu Comment #8 Reply to this comment
Actually, make that:



             if ($userinfo) {

                 if (is_array($userinfo) &&

                     !array_walk($userinfo,

                                 create_function('$a,$b,$c', 'return 
is_a($a,$c);'),

                                'PEAR_Error')) {

                     $userinfo = @implode(', ', $userinfo);

                 }

                 $ob->_message = $ob->getMessage() . ' : ' . $userinfo;

             }



so that the array_walk() comes after the is_array().
12/07/2006 08:16:31 PM cbs (at) cts (dot) ucla (dot) edu Comment #7 Reply to this comment
This was a bug, of sorts, in the Horde Notification package. I've
fixed it in HEAD and FW_3; it'll be in the next stable Horde release.
If the commit to Listener.php (line 102) was the only commit related 
to this, it doesn't fix it.  $userinfo is an array of 1 PEAR_Error, so 
the is_a() fails.  This works for me, so far:



             if ($userinfo &&

                 !array_walk($userinfo,

                             create_function('$a,$b,$c', 'return 
is_a($a,$c);'),

                             'PEAR_Error')) {


12/07/2006 06:22:01 PM Chuck Hagenbuch Comment #6
Version ⇒ HEAD
State ⇒ Resolved
Queue ⇒ Horde Framework Packages
Reply to this comment
This was a bug, of sorts, in the Horde Notification package. I've 
fixed it in HEAD and FW_3; it'll be in the next stable Horde release.
12/07/2006 09:44:19 AM cbs (at) cts (dot) ucla (dot) edu Comment #5 Reply to this comment
And, the reason that the implode is failing is because $userinfo is an 
array of one PEAR_Error object, not an array of strings.



PHP is 5.2.0, PEAR is 1.4.11.
12/07/2006 07:59:26 AM cbs (at) cts (dot) ucla (dot) edu Comment #4 Reply to this comment
After adding a lot more logging, I've tracked it to 
Horde/Notification/Listener.php:getEvent()



This isn't completing:



             if ($userinfo) {

                 if (is_array($userinfo)) {

                     $userinfo = @implode(', ', $userinfo);

                 }

                 $ob->_message = $ob->getMessage() . ' : ' . $userinfo;



The @implode is failing.  If I comment that out, I get back to the 
compose screen with one "Please resolve ambiguous or invalid 
addresses." message in a yellow warning box for every time that I 
reloaded / clicked "Expand Names".
12/07/2006 03:34:20 AM cbs (at) cts (dot) ucla (dot) edu Comment #3 Reply to this comment
horde is set to



$conf['debug_level'] = E_ALL;



php is set to log E_ALL



There is nothing unusual in the horde error log - the last line logged 
is writing the session data.  There is nothing in the apache error 
log.  It does not look like php is segfaulting.
12/07/2006 02:51:37 AM Chuck Hagenbuch Comment #2
State ⇒ Feedback
Reply to this comment
Is PHP segfaulting? Anything in your apache logs? What about PHP error 
reporting - is it turned on and at the highest level?
12/07/2006 12:07:07 AM cbs (at) cts (dot) ucla (dot) edu Comment #1
Priority ⇒ 1. Low
Type ⇒ Bug
Summary ⇒ php dying on IMP::status() call on line 56 of templates/compose/compose.inc
Queue ⇒ IMP
State ⇒ Unconfirmed
Reply to this comment
This is with IMP 4.1.3 and Horde 3.1.3



If I click Net Message, type in an address that is not in my address 
book (any keyboard mashing will do), then click Expand Addresses, the 
page posts, starts to reload, and then stops.



I traced it to the call to IMP::status() on line 56 of 
templates/compose/compose.inc



in lib/IMP.php, if I modify status() so that the last three lines are:



         if (class_exists('Notification_Listener_audio')) {

             $notification->notify(array('listeners' => 'audio'));

         }



instead of



         if (class_exists('Notification_Listener_audio')) {

             $notification->notify(array('listeners' => 
array('status', 'audio')));

         }



the page loads normally.



If I change the notifiy call to



             $notification->notify(array('listeners' => 'status'));



the page fails to not load.

Saved Queries