Summary | contact search box rendered PHP error |
Queue | Kolab |
Type | Bug |
State | Resolved |
Priority | 2. Medium |
Owners | wrobel (at) horde (dot) org |
Requester | m.gabriel (at) das-netzwerkteam (dot) de |
Created | 12/24/2007 (6376 days ago) |
Due | |
Updated | 03/20/2008 (6289 days ago) |
Assigned | 12/25/2007 (6375 days ago) |
Resolved | 03/20/2008 (6289 days ago) |
Github Issue Link | |
Github Pull Request | |
Milestone | |
Patch | No |
since searching in the Kolab driver was really horribly broken.
I'll close this one now but please reopen if testing shows further
problems in the new version.
thx,
mike
State ⇒ Resolved
since searching in the Kolab driver was really horribly broken.
I'll close this one now but please reopen if testing shows further
problems in the new version.
New Attachment: field+needle2.patch
Turba_Driver_kolab_wrapper_new class...
the application context is already described in
ticket #6046occurred(i a nutshell: i tried to add a CSV address book: LASTNAME, FIRSTNAME,
EMAIL).
on import the following php error is rendered:
Notice: Undefined index: last-name in
/usr/local/share/_horde-versions_/horde-webmail-1.1-rc1-netzwerkteam/turba/lib/Driver/kolab.php on line
775
this happens if the CSV contains lines like the third line in the
following example:
<snip csv-file>
Lastname, Firstname, eMail
Gabriel, Mike, user@mail.test
Onlylastname,,lastname@mail.test
</snip>
so i tuned up the _search method a little more... (patch also attached)...
grimnir:/usr/local/share/_horde-versions_# diff -u
/usr/local/share/_horde-versions_/horde-webmail-1.1-rc1/turba/lib/Driver/kolab.php
/usr/local/share/_horde-versions_/horde-webmail-1.1-rc1-netzwerkteam/turba/lib/Driver/kolab.php
---
/usr/local/share/_horde-versions_/horde-webmail-1.1-rc1/turba/lib/Driver/kolab.php 2007-11-29 12:32:57.000000000
+0000
+++
/usr/local/share/_horde-versions_/horde-webmail-1.1-rc1-netzwerkteam/turba/lib/Driver/kolab.php 2007-12-25 20:31:48.000000000
+0000
@@ -764,12 +764,15 @@
$all_matched = true;
foreach ($tests as $test) {
- $field = $test['field'];
- $needle = $test['test'];
-
+
+ $field = '';
+ $needle = '';
+ if (isset($test['field'])) { $field =
$test['field']; }
+ if (isset($test['test'])) { $needle =
$test['test']; }
+
if (empty($needle)) {
$keep_entry = true;
- } elseif (stristr($entry[$field],
$needle) !== false) {
+ } elseif (isset($entry[$field]) &&
(stristr($entry[$field], $needle) !== false)) {
$keep_entry = true;
} else {
$all_matched = false;
New Attachment: field+needle.patch
than anything and is rather python than php style...
grimnir:/usr/local/share/_horde-versions_# diff -u
/usr/local/share/_horde-versions_/horde-webmail-1.1-rc1/turba/lib/Driver/kolab.php
/usr/local/share/_horde-versions_/horde-webmail-1.1-rc1-netzwerkteam/turba/lib/Driver/kolab.php
---
/usr/local/share/_horde-versions_/horde-webmail-1.1-rc1/turba/lib/Driver/kolab.php 2007-11-29 12:32:57.000000000
+0000
+++
/usr/local/share/_horde-versions_/horde-webmail-1.1-rc1-netzwerkteam/turba/lib/Driver/kolab.php 2007-12-25 20:09:21.000000000
+0000
@@ -764,8 +764,11 @@
$all_matched = true;
foreach ($tests as $test) {
- $field = $test['field'];
- $needle = $test['test'];
+
+ $field = '';
+ $needle = '';
+ if (isset($test['field'])) { $field =
$test['field']; }
+ if (isset($test['test'])) { $needle =
$test['test']; }
if (empty($needle)) {
$keep_entry = true;
Assigned to Gunnar Wrobel
Priority ⇒ 2. Medium
Type ⇒ Bug
Summary ⇒ contact search box rendered PHP error
Queue ⇒ Kolab
State ⇒ Unconfirmed
when i began to setup my portal i did not import kolab's global
address book. at that time the portal block for contact search
rendered a php-error (that i unfortunately cannot reproduce any more)
in case the kolab user address book was empty. the patch below fixed
the problem...
$ diff horde-webmail-1.1-rc1/turba/lib/Driver/kolab.php
horde-webmail-1.1-rc1-netzwerkteam/turba/lib/Driver/kolab.php
767,768c767,771
< $field = $test['field'];
< $needle = $test['test'];
---
$test['field'] or '';
$needle = isset($test['test']) and
$test['test'] or '';
#$field = $test['field'];
#$needle = $test['test'];