[turba] Tons of PHP ERROR about indexes
Michael J Rubinsky
mrubinsk at horde.org
Wed Feb 1 15:39:27 UTC 2012
Quoting LALOT Dominique <dom.lalot at gmail.com>:
> 2012/1/31 Michael J Rubinsky <mrubinsk at horde.org>
>
>>
>> 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
So, you are saying that $this->driver->map[$attribute] ==
array('name')? That is bizarre. What is the value of $attribute when
this happens?
>>> 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
>>
>> --
>> Turba mailing list
>> Frequently Asked Questions: http://horde.org/faq/
>> To unsubscribe, mail:
>> turba-unsubscribe at lists.horde.**org<turba-unsubscribe at lists.horde.org>
>>
>
> here is my turba backends.local.php, backends.php is from distrib and
> contains localsql
These look OK at first glance.
>
> $cfgSources['favourites']['disabled']=true;
> $cfgSources['localldap'] = array(
> 'title' => 'Annuaire AMU',
> 'type' => 'ldap',
> 'disabled' => false,
> 'params' => array(
> 'server' => 'ldap2.xxxx.fr ldap1.xx.fr',
> 'port' => 389,
> 'root' => 'dc=univ-amu,dc=fr',
> 'dn' => array('uid'),
> 'encoding' => 'utf8',
> 'filter' =>
> '|(sn=listes-sympa)(edupersonaffiliation=employee)(edupersonaffiliation=researcher)(edupersonaffiliation=faculty)',
> 'sizelimit' => 30,
> 'scope' => 'sub',
> 'charset' => 'iso-8859-1',
> 'objectclass' => array('supannperson'),
> 'version' => 3,
> 'checksyntax' => false,
> ),
> 'map' => array(
> '__key' => 'dn',
> '__uid' => 'uid',
> 'uid' => 'uid',
> 'searchname' => 'sn',
> 'name' => 'displayname',
> 'alias' => 'givenname',
> 'email' => 'amumail',
> 'workPhone' => 'telephonenumber',
> 'cellPhone' => 'mobiletelephonenumber',
>
> 'freebusyUrl' => array(
> 'fields' => array('__uid'),
> 'format' =>
> Horde::url($GLOBALS['registry']->get('webroot', 'horde'),true) .
> '/kronolith/fb.php?u=%s',
> ),
> 'search' => array(
> 'name',
> ),
> ),
> 'strict' => array('dn'),
> 'browse' => false,
> 'export' => false,
> 'use_shares' => false,
> );
>
> $cfgSources['localsql']['map']['name']=array('fields' =>
> array('namePrefix', 'lastname',
> 'middlenames', 'firstname',
> 'nameSuffix'),
> 'format' => '%s %s %s %s %s',
> 'parse' => array(
> array('fields' => array('lastname',
> 'middlenames',
> 'firstname'),
> 'format' => '%s %s %s'),
> array('fields' => array('lastname',
> 'firstname'),
> 'format' => '%s %s')));
>
>
> --
> Dominique LALOT
> Ingénieur Systèmes et Réseaux
> http://annuaire.univmed.fr/showuser.php?uid=lalot
--
mike
The Horde Project (www.horde.org)
mrubinsk at horde.org
More information about the turba
mailing list