[turba] Tons of PHP ERROR about indexes

Michael J Rubinsky mrubinsk at horde.org
Tue Jan 31 14:28:32 UTC 2012


Quoting LALOT Dominique <dom.lalot at gmail.com>:

> 2012/1/31 LALOT Dominique <dom.lalot at gmail.com>
>
>> Hello,
>>
>> I am trying to get rid of large quantities of such errors, and don't know
>> what to do. PHP which was logging such messages as NOTICE is logging as
>> ERROR.
>> The traces appear with autocompletion (which is working by the way)
>> Can we do something to avoid that?
>>
>> Thanks
>>
>> Dom
>>
>> Jan 31 09:06:40 horde41 HORDE: [turba] PHP ERROR: Undefined index: fields
>> [pid 13478 on line 102 of "/var/www/horde/turba/lib/Object.php"]
>> Jan 31 09:06:40 horde41 HORDE: [turba] PHP ERROR: Invalid argument
>> supplied for foreach() [pid 13478 on line 102 of
>> "/var/www/horde/turba/lib/Object.php"]
>> Jan 31 09:06:40 horde41 HORDE: [turba] PHP ERROR: Undefined index: format
>> [pid 13478 on line 105 of "/var/www/horde/turba/lib/Object.php"]
>> Jan 31 09:06:40 horde41 HORDE: [turba] PHP ERROR: Undefined index: fields
>> [pid 13478 on line 102 of "/var/www/horde/turba/lib/Object.php"]
>> Jan 31 09:06:40 horde41 HORDE: [turba] PHP ERROR: Invalid argument
>> supplied for foreach() [pid 13478 on line 102 of
>> "/var/www/horde/turba/lib/Object.php"]
>> Jan 31 09:06:40 horde41 HORDE: [turba] PHP ERROR: Undefined index: format
>> [pid 13478 on line 105 of "/var/www/horde/turba/lib/Object.php"]
>> Jan 31 09:06:40 horde41 HORDE: [turba] PHP ERROR: Undefined index: fields
>> [pid 13478 on line 102 of "/var/www/horde/turba/lib/Object.php"]
>> Jan 31 09:06:40 horde41 HORDE: [turba] PHP ERROR: Invalid argument
>> supplied for foreach() [pid 13478 on line 102 of
>> "/var/www/horde/turba/lib/Object.php"]
>> Jan 31 09:06:40 horde41 HORDE: [turba] PHP ERROR: Undefined index: format
>> [pid 13478 on line 105 of "/var/www/horde/turba/lib/Object.php"]
>>
>
> I've added a test:
>             *if (isset($this->driver->map[$attribute]['fields'])){*
>               foreach ($this->driver->map[$attribute]['fields'] as $field) {
>                 $args[] = $this->getValue($field);
>               }
>               return
> Turba::formatCompositeField($this->driver->map[$attribute]['format'],
> $args);
>             }
>
> I suppose that something could be wrong in turba backends but I have'nt
> been able to find the cause.
> Trying to trace, that condition is true in getValue:
>      if (isset($this->driver->map[$attribute]) &&
>             is_array($this->driver->map[$attribute])) {
> and the array just contains 'name', without fields or format
> I just have a hook for search sources and search fields to avoid searching
> *attr* for lots of attributes in our ldap directory.
>
> As that function is called in autocomplete, this is generating lots of php
> ERRORS. Don't known why this is no more NOTICE..

The 'format' and 'fields' values are required values for a composite  
field. The only time that $this->driver->map[$attribute] would be an  
array (see the check on line 100) is if $attribute is referring to a  
composite field. Check your backends.php file for the map definition  
of the fields causing the problem.


-- 
mike

The Horde Project (www.horde.org)
mrubinsk at horde.org



More information about the turba mailing list