From b0870c8c805798523d3573da541c1fc7f9558eb1 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Thu, 23 Sep 2010 15:38:28 +0000 Subject: [PATCH] Make sure n_fn and n_fileas get updated when importing --- .../inc/class.addressbook_import_contacts_csv.inc.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/addressbook/inc/class.addressbook_import_contacts_csv.inc.php b/addressbook/inc/class.addressbook_import_contacts_csv.inc.php index ee13a3d3f2..525af0f60d 100644 --- a/addressbook/inc/class.addressbook_import_contacts_csv.inc.php +++ b/addressbook/inc/class.addressbook_import_contacts_csv.inc.php @@ -224,13 +224,21 @@ class addressbook_import_contacts_csv implements importexport_iface_import_plugi $changed = $this->tracking->changed_fields($_data, $old); if(count($changed) == 0) { return true; - } + } + + // Make sure n_fn gets updated + unset($_data['n_fn']); + // Fall through case 'insert' : if($_action == 'insert') { // Addressbook backend doesn't like inserting with ID specified, it screws up the owner & etag unset($_data['id']); } + if(!isset($_data['org_name'])) { + // org_name is a trigger to update n_fileas + $_data['org_name'] = ''; + } if ( $this->dry_run ) { //print_r($_data); $this->results[$_action]++;