[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kronolith
Subject:    [kronolith] =?iso-8859-1?q?M=FAltiple_results_finding_freebusy_ur?=
From:       Alfonso_Marí­n_Marí­n <almarin () um ! es>
Date:       2008-04-22 11:33:25
Message-ID: 480DCD05.3000104 () um ! es
[Download RAW message or body]

Hello list:

I have configured in turba two different sources (one in BD and other is 
LDAP), and sometimes, an user with a freebusyurl could be in both of 
them with a duplicate freebusyurl entry.

In that cases, kronolith gives me an error (freebusy info not found). It 
happens because kronolith uses turba's api method 'getField'. This 
method, if parameter $multiple=true not defined, returns an PEAR_Error: 
More than 1 entry found.

So... I wonder... Should be desirable that, at least, the first result 
was returned instead an PEAR_Error?

To give a pointer, I attach a simple patch to support this behavior

Kind Regards
Alfonso


["FreeBusy.php.patch" (text/x-patch)]

Index: FreeBusy.php
===================================================================
RCS file: /repository/kronolith/lib/FreeBusy.php,v
retrieving revision 1.13
diff -u -r1.13 FreeBusy.php
--- FreeBusy.php	15 Mar 2008 17:51:05 -0000	1.13
+++ FreeBusy.php	22 Apr 2008 11:24:36 -0000
@@ -246,8 +246,9 @@
         $sources = $GLOBALS['prefs']->getValue('search_sources');
         $sources = empty($sources) ? array() : explode("\t", $sources);
 
-        return $GLOBALS['registry']->call('contacts/getField',
-                                          array($email, 'freebusyUrl', $sources, true));
+        $urls=$GLOBALS['registry']->call('contacts/getField',
+                                          array($email, 'freebusyUrl', $sources, true, true));
+        return is_array($urls)?reset($urls):$urls;
     }
 
 }


-- 
Kronolith mailing list - Join the hunt: http://horde.org/bounties/#kronolith
Frequently Asked Questions: http://horde.org/faq/
To unsubscribe, mail: kronolith-unsubscribe@lists.horde.org


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic