[Tickets #7357] getAddressBookOrder() returns empty array when "addressbooks" preference is empty

bugs at horde.org bugs at horde.org
Thu Sep 18 16:35:33 UTC 2008


DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: http://bugs.horde.org/ticket/7357
------------------------------------------------------------------------------
  Ticket             | 7357
  Created By         | morgan at orst.edu
  Summary            | getAddressBookOrder() returns empty array when
                     | "addressbooks" preference is empty
  Queue              | Turba
  Version            | 2.3-RC1
  Type               | Bug
  State              | Unconfirmed
  Priority           | 1. Low
  Milestone          |
  Patch              |
  Owners             |
------------------------------------------------------------------------------


morgan at orst.edu (2008-09-18 12:35) wrote:

The comment in turba/config/prefs.php for the "addressbooks" preference says:

// Address books to be displayed in the address book selection widget
// and in the Browse menu item.  The address book name is stored using
// the source key from sources.php (e.g. "localsql").  Separate
// entries with "\n" , e. g. 'value' => "localsql\nlocalldap" (the
// double quotes are REQUIRED).  If 'value' is empty (''), all address
// books that the user has permissions to will be listed.

In particular, it says if the value is empty that all address books  
will be listed.

However, if the user does not have this preference set to something,  
the Address Book
widget from IMP behaves strangely.  The IMP Address Book widget calls  
the Turba API
"search" function.  The "search" function calls  
Turba::getAddressBookOrder() to
validate the list of sources provided.  If the "addressbooks"  
preference is empty,
Turba::getAddressBookOrder() returns an empty array and all sources  
are removed.
Then, the "search" function adds back in the default source.

In my installation, there are 3 Turba sources: localsql, localldap,  
and favourites.
The IMP Address Book widget lists all 3 in the search form, but no  
matter which one I
choose, it always searches the "localsql" source (my default).

I fixed this problem by setting the "addressbooks" preference to
"localsql\nlocalldap\nfavourites" and locking it.

However, it would be nice if the search form behaved better.  Maybe
Turba::getAddressBookOrder() could return all address books that the user has
permission to, in some random order, if the "addressbooks" preference  
is empty?  Or
perhaps the IMP Address Book widget should only allow you to select  
from addressbooks
that will actually be used in the search.






More information about the bugs mailing list