[horde] Turba question + notes for everyone on updagrading to 5.3
Nybbles2Byte
nybbles2byte at gmail.com
Sat Mar 20 07:27:03 UTC 2010
Hello Horde,
I recently upgraded to php 5.3.
As expected I got a ton of deprecated warnings but that's fine since I am a programmer. For anyone who wants to do the same you will get rid of 95% or more of the errors with the following 3 steps:
Put:
"date_default_timezone_set(@date_default_timezone_get());
at the top of index.php and login.php -- not ideal but will do for the short term. This will knock out all the time function warnings.
Do a search and replace changing:
'= &new ' to '= new '
and
'=& new ' to '= new '
These two will knock out all the 'new by reference' warnings.
And what's left is a small enough quantity of errors to do on case by case basis reasonably quickly which means using the '@' symbol to suppress the warnings.
However once that was all done I had one warning left I suspect it is a turba coding error but I want to ask "those in the know" since I am anything but an expert on horde. So, here it goes...
In
horde/turba/lib/Driver/favourites.php -> function _getAddressBook() on line 123 there is this line:
$addresses = $registry->call('contacts/favouriteRecipients', $this->_params['limit']);
where $this->_params['limit'] is the integer 10 which seems to be picked up from sources.php
That is from here:
cfgSources['favourites'] = array(
'title' => _("Favourite Recipients"),
'type' => 'favourites',
'params' => array(
'limit' => 10
),
it calls: horde/lib/Horde/Registry.php -> function call($method, $args = array())
which as you can see is expecting at array of $args but args as we know is the integer 10.
it has this call:
return $this->callByPackage($app, $call, $args);
which as you can see calls:
horde/lib/Horde/Registry.php -> function callByPackage($app, $call, $args = array())
In this function on line 630 is this line of code:
$res = call_user_func_array($function, $args);
which is expecting $args to be an array and gives the warning "expecting array as the 2nd parameter".
This I think is a bug that for some reason wasn't giving an error in previous versions of php which might be to do with error_reporting(0) being all throughout horde. I say this because for some reason error_reporting(0) won't necessarily stop warnings in php 5.3 which I believe has been reported as a bug to the php team -- there might be some irony in there somewhere.
My questions are three-fold, does any with some knowledge of horde/turba know if this looks like a bug to them? And, whether a bug or not, for the short term I need to get rid of it so do you know which would be better, this:
$addresses = $registry->call('contacts/favouriteRecipients', array($this->_params['limit']));
or
$addresses = $registry->call('contacts/favouriteRecipients', $this->_params);
(personally I think this one is more likely correct)
or something else as an immediate fix while waiting for the turba guys to resolve it?
And last, if you agree it's a bug do you know where to report it? as I am guessing the forums aren't the place.
--
Nybbles2Byte mailto:nybbles2byte at gmail.com
More information about the horde
mailing list