From abe6ce3482e52244522661ae2441e3857c6be91b Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Wed, 25 Jan 2012 17:31:57 +0000 Subject: [PATCH] Fix bug in condition matching on account ID, if account ID is not in file --- admin/inc/class.admin_import_groups_csv.inc.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/admin/inc/class.admin_import_groups_csv.inc.php b/admin/inc/class.admin_import_groups_csv.inc.php index 0a61a5fb6d..afed1f6891 100644 --- a/admin/inc/class.admin_import_groups_csv.inc.php +++ b/admin/inc/class.admin_import_groups_csv.inc.php @@ -123,11 +123,17 @@ class admin_import_groups_csv implements importexport_iface_import_plugin { switch ( $condition['type'] ) { // exists case 'exists' : - $accounts = $GLOBALS['egw']->accounts->search(array( - 'type' => 'groups', - 'query' => $record[$condition['string']], - 'query_type' => $condition['string'] - )); + $accounts = array(); + + // Skip the search if the field is empty + if($record[$condition['string']] !== '') { + + $accounts = $GLOBALS['egw']->accounts->search(array( + 'type' => 'groups', + 'query' => $record[$condition['string']], + 'query_type' => $condition['string'] + )); + } if ( is_array( $accounts ) && count( $accounts ) >= 1 ) { $account = current($accounts); // apply action to all contacts matching this exists condition