FreeBSD Horde php4.4.0 Error

* Note that this is a old article saved from a previous blog

So today I upgraded my PHP version to 4.4.0 on this FreeBSD box, Everything seemed to be okay untill I loaded up my webmail thats running Horde. I got a few errors:

Notice: Only variable references should be returned by reference in
/webmail/horde/lib/Horde/Notification.php on line 98
Notice: Only variable references should be returned by reference in
/webmail/horde/kronolith/lib/Kronolith.php on line 459

So crap, that looks like a bug in horde, as I was a version behind on horde I patched my horde, imp, kronolith to the latest version to see if that fixed it.
But badly enough it didn’t fixed it
After searching the bug list I found it here bug nr 2261. Here they notice that its a bug in PHP, and someone els that it can be fixed by removing the ‘&’s.

This is a backward compatibility break in PHP, so don't blame us.
We are fixing those notices where we see them, any help in form of patches is welcome.

I don’t know if this really work, but the error message goes away 🙂

horde/lib/Horde/IMAP/Tree.php
Remove the & on line 292.

horde/lib/Horde/Notification.php
Remove the & on line 94.

Well the last option certainly works. I like to have a patch for it to not get in trouble upgrading to new versions.
After checking the mailing lists I noticed it was partially fixed in rc2, So it was time to upgrade to rc2.

# cd /webmail/horde/
# wget http://ftp.horde.org/pub/horde/patches/patch-horde-3.0.4-3.0.5-rc1.gz
# gunzip patch-horde-3.0.4-3.0.5-rc1.gz
# patch -p1 < patch-horde-3.0.4-3.0.5-rc1
# wget http://ftp.horde.org/pub/horde/patches/patch-horde-3.0.5-rc1-3.0.5-rc2.gz
# gunzip patch-horde-3.0.5-rc1-3.0.5-rc2.gz
# patch -p1 < patch-horde-3.0.5-rc1-3.0.5-rc2

Well this seemed to fix it in horde, but still had it in kronolith but there is no fix in kronolith for it yet.. So I had to fix that manually.
Checking the code I had to remove the & on line 366 before _getEvents.

# cd /webmail/horde/kronolith/lib
# cp Kronolith.php Kronolith.php.bak
# vi Kronolith.php

And change line 366 from:
    function &_getEvents(&$results, &$event, $startDate, $endDate,

to:
    function _getEvents(&$results, &$event, $startDate, $endDate,

That fixed it for now, now its time to wait for the official patch :)..

Tags: ,
Copyright 2021. All rights reserved.

Posted February 23, 2007 by TroubleNow in category "FreeBSD", "Horde