<?xml version="1.0" encoding="UTF-8"?> 
<?xml-stylesheet href="https://dev.horde.org/themes/horde//default/feed-rss.xsl" type="text/xsl"?> 
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> 
 <channel> 
  <title>getAddressBookOrder() returns empty array when &quot;addressbooks&quot; preference is empty</title> 
  <pubDate>Sun, 05 Apr 2026 20:34:24 +0000</pubDate> 
  <link>https://bugs.horde.org/ticket/7357</link> 
  <atom:link rel="self" type="application/rss+xml" title="getAddressBookOrder() returns empty array when &quot;addressbooks&quot; preference is empty" href="https://bugs.horde.org/ticket/7357/rss" /> 
  <description>getAddressBookOrder() returns empty array when &quot;addressbooks&quot; preference is empty</description> 
 
   
   
  <item> 
   <title>The comment in turba/config/prefs.php for the &quot;addressbooks&quot;</title> 
   <description>The comment in turba/config/prefs.php for the &quot;addressbooks&quot; 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. &quot;localsql&quot;).  Separate

// entries with &quot;\n&quot; , e. g. &#039;value&#039; =&gt; &quot;localsql\nlocalldap&quot; (the

// double quotes are REQUIRED).  If &#039;value&#039; is empty (&#039;&#039;), 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

&quot;search&quot; function.  The &quot;search&quot; function calls Turba::getAddressBookOrder() to

validate the list of sources provided.  If the &quot;addressbooks&quot; preference is empty,

Turba::getAddressBookOrder() returns an empty array and all sources are removed.

Then, the &quot;search&quot; 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 &quot;localsql&quot; source (my default).



I fixed this problem by setting the &quot;addressbooks&quot; preference to

&quot;localsql\nlocalldap\nfavourites&quot; 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 &quot;addressbooks&quot; 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.

</description> 
   <pubDate>Thu, 18 Sep 2008 16:35:33 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7357#t49001</link> 
  </item> 
   
  <item> 
   <title>Changes have been made in CVS for this ticket:

http://cvs.h</title> 
   <description>Changes have been made in CVS for this ticket:

http://cvs.horde.org/diff.php/turba/lib/api.php?r1=1.264&amp;r2=1.265&amp;ty=u</description> 
   <pubDate>Thu, 18 Sep 2008 17:18:25 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7357#t49003</link> 
  </item> 
   
  <item> 
   <title>Fixed for Turba 2.3</title> 
   <description>Fixed for Turba 2.3</description> 
   <pubDate>Thu, 18 Sep 2008 17:29:11 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7357#t49004</link> 
  </item> 
   
   
 
 </channel> 
</rss> 
