6.0.0-beta1
7/18/25

[#7357] getAddressBookOrder() returns empty array when "addressbooks" preference is empty
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 mrubinsk (at) horde (dot) org
Requester morgan (at) orst (dot) edu
Created 09/18/2008 (6147 days ago)
Due
Updated 09/18/2008 (6147 days ago)
Assigned 09/18/2008 (6147 days ago)
Resolved 09/18/2008 (6147 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
09/18/2008 05:29:11 PM Michael Rubinsky Comment #3
State ⇒ Resolved
Reply to this comment
Fixed for Turba 2.3
09/18/2008 05:18:25 PM CVS Commit Comment #2 Reply to this comment
Changes have been made in CVS for this ticket:

http://cvs.horde.org/diff.php/turba/lib/api.php?r1=1.264&r2=1.265&ty=u
09/18/2008 05:05:47 PM Michael Rubinsky Assigned to Michael Rubinsky
State ⇒ Assigned
 
09/18/2008 04:35:33 PM morgan (at) orst (dot) edu Comment #1
Priority ⇒ 1. Low
Type ⇒ Bug
Summary ⇒ getAddressBookOrder() returns empty array when "addressbooks" preference is empty
Queue ⇒ Turba
Milestone ⇒
Patch ⇒ No
State ⇒ Unconfirmed
Reply to this comment
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.


Saved Queries