| Summary | getAddressBookOrder() returns empty array when "addressbooks" preference is empty |
| Queue | Turba |
| Queue Version | 2.3-RC1 |
| Type | Bug |
| State | Resolved |
| Priority | 1. Low |
| Owners | Michael Rubinsky <mrubinsk (at) horde (dot) org> |
| Requester | morgan (at) orst (dot) edu |
| Created | 09/18/2008 (1709 days ago) |
| Due | |
| Updated | 09/18/2008 (1709 days ago) |
| Assigned | 09/18/2008 (1709 days ago) |
| Resolved | 09/18/2008 (1709 days ago) |
| Attachments | |
| Milestone | |
| Patch | No |
State ⇒ Resolved
http://cvs.horde.org/diff.php/turba/lib/api.php?r1=1.264&r2=1.265&ty=u
Assigned to Michael Rubinsky
State ⇒ Unconfirmed
Patch ⇒ No
Milestone ⇒
Queue ⇒ Turba
Summary ⇒ getAddressBookOrder() returns empty array when "addressbooks" preference is empty
Type ⇒ Bug
Priority ⇒ 1. Low
// 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.