[Kolab-devel] an event breaking lib/Horde/Kolab/Freebusy.php
Mike Gabriel
m.gabriel at das-netzwerkteam.de
Mon Mar 3 19:33:05 CET 2008
hi gunnar,
i have an event that breaks lib/Horde/Kolab/Freebusy.php with the
following php error in the middle of freebusy/trigger:
Fatal error: Call to a member function timestamp() on a non-object in
/usr/local/share/_horde-versions_/horde3-webmail-1.1-rc1-netzwerkteam/lib/Horde/Kolab/Freebusy.php on line
172
here is the event that stops fb-cache file generation (i have crossed
out the location field):
object(Kolab_Event)#57 (8) { ["eventID"]=> string(32)
"db0edbbb1d9acf0309ce34506e36e999" ["start"]=> object(Horde_Date)#58
(7) { ["year"]=> int(2008) ["month"]=> int(1) ["mday"]=> int(22)
["hour"]=> int(7) ["min"]=> int(0) ["sec"]=> int(0)
["_supportedSpecs"]=> string(21) "%CdDeHImMnRStTyYbBpxX" } ["end"]=>
object(Horde_Date)#59 (7) { ["year"]=> int(2008) ["month"]=> int(1)
["mday"]=> int(22) ["hour"]=> int(8) ["min"]=> int(0) ["sec"]=>
int(0) ["_supportedSpecs"]=> string(21) "%CdDeHImMnRStTyYbBpxX" }
["title"]=> string(10) "Pilates PT" ["location"]=> string(30)
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" ["private"]=> bool(false)
["status"]=> int(2) ["recurrence"]=>
object(Horde_Date_Recurrence)#60 (7) { ["start"]=>
object(Horde_Date)#61 (7) { ["year"]=> int(2008) ["month"]=> int(1)
["mday"]=> int(22) ["hour"]=> int(7) ["min"]=> int(0) ["sec"]=>
int(0) ["_supportedSpecs"]=> string(21) "%CdDeHImMnRStTyYbBpxX" }
["recurEnd"]=> NULL ["recurCount"]=> int(5) ["recurType"]=> int(2)
["recurInterval"]=> int(1) ["recurData"]=> int(4) ["exceptions"]=>
array(0) { } } }
when i change some code in Horde_Kolab_Freebusy::listEvents(), the
fb-generation works, but i feel that my fix is rather a workaround for
some other culprit:
<schnipp>
function listEvents($startDate = null, $endDate = null)
{
/* do recurrence expansion if not keeping anyway */
var_dump($event);
if ($event->recurs()) {
$next = $event->recurrence->nextRecurrence($startDate);
while ($next !== false &&
$event->recurrence->hasException($next->year,
$next->month,
$next->mday)) {
$next->mday++;
$next = $event->recurrence->nextRecurrence($next);
}
+ if ( $next ) {
-> raises error: $duration = $next->timestamp() -
$event->start->timestamp();
because $next
is NULL/false
$next_end = &new Horde_Date($event->end->timestamp() +
$duration);
+ }
if ($next !== false &&
(!(($endDate->compareDateTime($next) < 0) ||
($startDate->compareDateTime($next_end) > 0)))) {
$result[] = $event;
}
}
}
return $result;
}
</schnapp>
best,
mike
--
das netzwerkteam
mike gabriel, hamburger chaussee 240, 24113 kiel
fon: +49 431 64 74 196
voip/voicemail: +49 431 643 643 6
fax: +49 431 64 74 276
mail: m.gabriel at das-netzwerkteam.de, http://das-netzwerkteam.de
FreeBusy:
https://mail.das-netzwerkteam.de/mailxchange/kronolith/fb.php?u=m.gabriel%40das-netzwerkteam.de
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
More information about the devel
mailing list