Summary | Searching "My Contacts" with Kolab2 doesn't work |
Queue | Kolab |
Type | Bug |
State | Resolved |
Priority | 2. Medium |
Owners | wrobel (at) horde (dot) org |
Requester | bestellung (at) schurkennetz (dot) de |
Created | 01/01/2006 (7115 days ago) |
Due | |
Updated | 05/29/2007 (6602 days ago) |
Assigned | 05/24/2006 (6972 days ago) |
Resolved | 05/29/2007 (6602 days ago) |
Github Issue Link | |
Github Pull Request | |
Milestone | |
Patch | Yes |
State ⇒ Resolved
Taken from stuart
should'n be case sensitive as it is at the moment..
my name is Hermann Robin. I am using Horde version 3.1.1 with turba
version H3(2.1.1) and imp version H3(4.1.2) with Kolab version 2.0.3.
I fixed some problems with the turba addressbook by using your patches
"fix_addressbook_search_one.patch" and
"fix_addressbook_search_two.patch". But after these,i have some
further problems with the turba adressbook. First: i can't import any
addresse from csv-files (for each entry an "Already exists" error
message appears) and second: listing each entry of the adressbook by
composing a new message under the imp application, the listing in the
addressbook window is always empty, although there are any existing
entries for the users wich is currently logged in and a listing of the
addressbook by using the turba apllication always succeeded (all
entries will be displayed). I found out, that the imp apllication uses
a different search type as the turba apllication does it by clicking
on the Addressbook "List" Button from menu. Both searches are creating
an array called $criteria for the search function. The turba
apllication creates for a simple listing an simple array with the keys
"[0] => 'owner' [1] => '=' [2] => 'mailaddr@domain.tld'. This array
discribes what the search function should do. The imp apllication
creates a more complex array with more criterias combined with the
logical 'OR' operator. It seems to me, that these criterias combined
by the 'OR' operator, will never take place and the result of this
search is always empty. I fixed this problem by changing the
_matchCriteria function in the turba/lib/Driver/kolab.php file as
followed:
function _matchCriteria($contact, $criteria)
{
$values = array_values($criteria);
$values = $values[0];
$ok = true;
for ($current = 0; $current < count($values); ++$current) {
$temp = $values[$current];
while (!empty($temp) && !array_key_exists('field', $temp)) {
$temp = array_values($temp);
$temp = $temp[0];
}
if (empty($temp)) {
continue;
}
//-------------------------------------------------------------------------------------------------------------------------------------
if (array_key_exists('OR', $values[1])) {
if ( $temp['field'] == "full-name") {
continue;
}
}
//-----------------------------------------------------------------------------------------------------------------------
$searchkey = $temp['field'];
$searchval = $temp['test'];
if (strstr($contact[$searchkey], $searchval) == false) {
$ok = $ok && false;
} else {
$ok = $ok && true;
}
}
return $ok;
}
}
#############################################################################
This modification caused that, only and whenever the imp apllication
is searching in the adressbook by clicking on the "Addressbook" Button
while composing a new message, the "for" loop will be continued if
this specific search is carried out by the imp adressbook. search. So
the result $ok of this function will return "true" an the entries will
be display, the import of csv files will also work properly.
I hope, that the modification i made are okay. Anyhow everything
works. Perhaps, someone still knows a better solution of this problem.
not fully understand why the function "listObjectsInFolder" has been
added to the kolab.php driver.
The search uses a call to "listFolders" which grabs all readable
contact folders on the kolab server and will subsequently search each
of them. This breaks the logic of a turba share in my eyes. If I
understand it correctly, the turba driver should map one share to one
addressbook (e.g. ONE kolab folder)
Each accessible shared folder should probably be represented by a
source in sources.php. There is a corresponding TODO note in the
sources file.
I'll create a patch that fixes the problem but if somebody has
objections I'd like to know if my assumptions are wrong :)
Assigned to stuart
Taken from
State ⇒ Assigned
Giving back to the Kolab team for final fixes, tweaks, etc.
failing silently if the method doesn't exists as an alternative.
Otherwise the solution should be implemented in Turba only.
State ⇒ Feedback
then using it in the Turba driver. Do we consider that okay with
Kolab, or does another way need to be found?
i have found another Problem with the Patches,
Wenn i try to add a Address from a Mail and it is the first Address, i
wan´t to put in "My Adressbook" after the Patch, it works. But every
Adress after that wont work, and i get the Information "Already
Exists" in IMP.
It only works, if i set:
" } elseif ($result->count() > 1) { "
on Line 575 in turba/lib/api.php
Thomas Nintemann
attached are two patches which replace the imap search by a php based search.
Thanks for the Patches, they work great on my site.
The only thing i had to do with your "fix_adressbook_search_one.patch"
was to uncomment the lines 96,97,98 then it works for me.
Thomas Nintemann
Taken from stuart
New Attachment: fix_addressbook_search_two.patch
New Attachment: fix_addressbook_search_one.patch
attached are two patches which replace the imap search by a php based search.
I guess the IMAP search never worked correctly, because
1) IMAP can't search recursive, so a search on the INBOX will always
return 0 entries
2) Using the 'BODY' search flag doesn't work with cyrus, either it
doesn't search in parts where
mimetype != 'text/plain' or it can't search in mimeparts
Ciao,
Tobias
Releases. I use Kolab 2.0.3.
work as supposed, but browsing "My Contacts" from within IMP doesn't
work. The window remains empty.
Kind regards
State ⇒ Assigned
Queue ⇒ Kolab
Priority ⇒ 1. Low
State ⇒ Unconfirmed
Queue ⇒ Turba
Type ⇒ Bug
Summary ⇒ Searching "My Contacts" with Kolab2 doesn't work
I'm using horde, turba and imp from CVS (turba shows version 2.2-CVS)
together with Kolab 2.01.
When I try to search "My Contacts", the results are always empty. But
browsing "My Contacts" works as supposed. Searching the global address
book works as well.
When I try to use the address book from within IMP, it only works for
the global addressbook. Browsing "My Contacts" doesn't work at all.
This is the turba-datatree:
-----------------------------------
Array
(
)
Array
(
[0] => Array
(
[name] => perm_users
[key] => manu@homebase.local
[value] => 30
)
[1] => Array
(
[name] => name
[key] =>
[value] => Manuel's Address Book
)
[2] => Array
(
[name] => owner
[key] =>
[value] => manu@homebase.local
)
)
------------------------------------------
Kind regards