6.0.0-beta1
7/4/25

[#9324] Horde_Session vs Horde_Notification
Summary Horde_Session vs Horde_Notification
Queue Horde Framework Packages
Queue Version Git master
Type Bug
State Resolved
Priority 2. Medium
Owners slusarz (at) horde (dot) org
Requester jan (at) horde (dot) org
Created 10/20/2010 (5371 days ago)
Due
Updated 10/21/2010 (5370 days ago)
Assigned 10/20/2010 (5371 days ago)
Resolved 10/21/2010 (5370 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
10/21/2010 08:57:42 AM Jan Schneider State ⇒ Resolved
 
10/21/2010 01:24:45 AM Git Commit Comment #7 Reply to this comment
Changes have been made in Git for this ticket:

Bug #9313: Fix logintask confirmation
Session data type might change - if it changes from array/object to
scalar, remove the typehint declaration stored in the session.

Possibly fixes Bug #9324
Possibly fixes Bug #9325

http://git.horde.org/diff.php/framework/Core/lib/Horde/Session.php?rt=horde-git&r1=0ab36983a478f9137f04e428f85ccd389e617710&r2=6d69e71624b0a9bcc47b62d64c4f0e002b64fbe0
10/20/2010 06:36:19 PM Michael Slusarz Comment #6 Reply to this comment
<code>
         $events = $session['horde:notify/' . $listener . ';array'];
         $events[] = $event;
         $session['horde:notify/' . $listener . ';object'] = $events;
</code>

The entity being serialized is the array returned from the first 
assignment (and appended to on the second line).
That's what is expected.  $events is an array of Event objects.  Thus 
it needs to be serialized to maintain the object.

Here's what my notification session entry looks like:
a:2:{i:0;O:30:"Horde_Core_Notification_Status":5:{s:12:"?*?_coreDict";O:25:"Horde_Translation_Gettext":2:{s:10:"?*?_domain";s:10:"Horde_Core";s:11:"?*?_gettext";b:1;}s:7:"charset";s:5:"UTF-8";s:7:"message";s:3:"foo";s:5:"flags";a:0:{}s:4:"type";s:12:"horde.notice";}i:1;O:30:"Horde_Core_Notification_Status":5:{s:12:"?*?_coreDict";O:25:"Horde_Translation_Gettext":2:{s:10:"?*?_domain";s:10:"Horde_Core";s:11:"?*?_gettext";b:1;}s:7:"charset";s:5:"UTF-8";s:7:"message";s:3:"foo";s:5:"flags";a:0:{}s:4:"type";s:12:"horde.notice";}}
10/20/2010 06:22:25 PM Michael Rubinsky Comment #5 Reply to this comment

[Show Quoted Text - 11 lines]
dumping $_SESSION shows that it is indeed serialized, but the problem 
is, it's serializing an array, not an object:

<code>
         $events = $session['horde:notify/' . $listener . ';array'];
         $events[] = $event;
         $session['horde:notify/' . $listener . ';object'] = $events;
</code>

The entity being serialized is the array returned from the first 
assignment (and appended to on the second line).
10/20/2010 05:10:51 PM Michael Slusarz Comment #4 Reply to this comment
This is *exactly* what the code in 
Horde_Core_Notification_Storage_Session is designed to prevent:

line 59: $session['horde:notify/' . $listener . ';object'] = $events;

This tells the session handler to force save this entry as an object 
(using serialization) rather than doing type checking (which would 
return array which would cause it to be json encoded).  This is 
probably a good place to start debugging- it works perfectly for me 
here.

10/20/2010 04:29:48 PM Jan Schneider Comment #3 Reply to this comment
The point is that it *is* an array, while it's supposed to be a 
notification event object.
10/20/2010 03:56:46 PM Michael Slusarz Comment #2
Priority ⇒ 2. Medium
State ⇒ Feedback
Reply to this comment
Definitely don't see this.  What is the value of the unattached array 
on line 303?
10/20/2010 03:04:39 PM Jan Schneider Comment #1
Priority ⇒ 3. High
Type ⇒ Bug
Summary ⇒ Horde_Session vs Horde_Notification
Queue ⇒ Horde Framework Packages
Assigned to Michael Slusarz
Milestone ⇒
Patch ⇒ No
State ⇒ Assigned
Reply to this comment
The notification system seems to be broken since the session changes. 
I see this when logging in to the portal:
[Wed Oct 20 16:48:11 2010] [error] [client 192.168.60.116] PHP Notice: 
  Trying to get property of non-object in 
/home/jan/horde-git/framework/Notification/lib/Horde/Notification/Handler.php 
on line 303, referer: 
http://neo.wg.de/headhorde/login.php?Horde=s3k1hnavnpp24672atoifp3mo1
[Wed Oct 20 16:48:11 2010] [error] [client 192.168.60.116] PHP Stack 
trace:, referer: 
http://neo.wg.de/headhorde/login.php?Horde=s3k1hnavnpp24672atoifp3mo1
[Wed Oct 20 16:48:11 2010] [error] [client 192.168.60.116] PHP   1. 
{main}() /home/jan/horde-git/horde/services/portal/index.php:0, 
referer: 
http://neo.wg.de/headhorde/login.php?Horde=s3k1hnavnpp24672atoifp3mo1
[Wed Oct 20 16:48:11 2010] [error] [client 192.168.60.116] PHP   2. 
Horde_Notification_Handler->notify($options = array ('listeners' => 
'status')) /home/jan/horde-git/horde/services/portal/index.php:71, 
referer: 
http://neo.wg.de/headhorde/login.php?Horde=s3k1hnavnpp24672atoifp3mo1

This also breaks complete access to DIMP:
[Wed Oct 20 16:48:31 2010] [error] [client 192.168.60.116] PHP Notice: 
  Trying to get property of non-object in 
/home/jan/horde-git/framework/Notification/lib/Horde/Notification/Handler.php 
on line 303, referer: http://neo.wg.de/headhorde/imp/index-dimp.php
[Wed Oct 20 16:48:31 2010] [error] [client 192.168.60.116] PHP Stack 
trace:, referer: http://neo.wg.de/headhorde/imp/index-dimp.php
[Wed Oct 20 16:48:31 2010] [error] [client 192.168.60.116] PHP   1. 
{main}() /home/jan/horde-git/horde/services/ajax.php:0, referer: 
http://neo.wg.de/headhorde/imp/index-dimp.php
[Wed Oct 20 16:48:31 2010] [error] [client 192.168.60.116] PHP   2. 
Horde::prepareResponse($data = class stdClass { public $portal = '<div 
id="portalchunk"> \\n \\n <div class="headerbox"> \\n  <h1 
class="header"><a app="imp">Ordner\xc3\xbcbersicht</a></h1> \\n   
<!--a75c305b1c0a6022--><table cellspacing="0" width="100%"><tr 
style="cursor:pointer" class="text" 
onclick="try{DimpBase.go(\\'folder:INBOX\\');}catch(e){window.location=\\'/headhorde/imp/#folder%3AINBOX\\';}return false;"><td><strong><a>Posteingang</a></strong></td><td><strong>11</strong></td></tr><tr style="cursor:pointer" class="text" onclick="try{DimpBase.go(\\'folder:INBOX.horde.apps\\');}catch(e){window.location=...'; public $linkTags = array () }, $notify = TRUE) /home/jan/horde-git/horde/services/ajax.php:73, referer: 
http://neo.wg.de/headhorde/imp/index-dimp.php
[Wed Oct 20 16:48:31 2010] [error] [client 192.168.60.116] PHP   3. 
Horde_Notification_Handler->notify($options = array ('listeners' => 
'status', 'raw' => TRUE)) 
/home/jan/horde-git/framework/Core/lib/Horde.php:546, referer: 
http://neo.wg.de/headhorde/imp/index-dimp.php

Saved Queries