Fix for import / update search for existing record. If new record key (ex ID) was not set, address search matched all

This commit is contained in:
Nathan Gray 2011-03-14 20:08:00 +00:00
parent e1c084ee0c
commit c907e92398

View File

@ -172,14 +172,15 @@ class addressbook_import_contacts_csv implements importexport_iface_import_plugi
switch ( $condition['type'] ) {
// exists
case 'exists' :
$contacts = $this->bocontacts->search(
//array( $condition['string'] => $record[$condition['string']],),
'',
$_definition->plugin_options['update_cats'] == 'add' ? false : true,
'', '', '', false, 'AND', false,
array( $condition['string'] => $record[$condition['string']],)
);
if($record[$condition['string']]) {
$contacts = $this->bocontacts->search(
//array( $condition['string'] => $record[$condition['string']],),
'',
$_definition->plugin_options['update_cats'] == 'add' ? false : true,
'', '', '', false, 'AND', false,
array( $condition['string'] => $record[$condition['string']])
);
}
if ( is_array( $contacts ) && count( array_keys( $contacts ) >= 1 ) ) {
// apply action to all contacts matching this exists condition
$action = $condition['true'];