From 0d89ddd3fab349aecff05651645ff712bb29896a Mon Sep 17 00:00:00 2001 From: babelouest Date: Tue, 10 Feb 2015 14:41:28 -0500 Subject: [PATCH 1/3] fix bug #810 that imports a phone number as PHONE property, rather than a TEL proerty --- formats/import_csv_gmail_connector.xml | 4 ++-- formats/import_csv_yahoo_connector.xml | 14 +++++++------- formats/import_vcard_yahoo_connector.xml | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/formats/import_csv_gmail_connector.xml b/formats/import_csv_gmail_connector.xml index b942fb82..f46a60b7 100644 --- a/formats/import_csv_gmail_connector.xml +++ b/formats/import_csv_gmail_connector.xml @@ -162,12 +162,12 @@ author: Nicolas Mora mail@babelouest.org - + - + diff --git a/formats/import_csv_yahoo_connector.xml b/formats/import_csv_yahoo_connector.xml index 337a4cf8..ac318cf7 100644 --- a/formats/import_csv_yahoo_connector.xml +++ b/formats/import_csv_yahoo_connector.xml @@ -115,37 +115,37 @@ author: Nicolas Mora mail@babelouest.org - + - + - + - + - + - + - + diff --git a/formats/import_vcard_yahoo_connector.xml b/formats/import_vcard_yahoo_connector.xml index f8bded63..bc4307a2 100644 --- a/formats/import_vcard_yahoo_connector.xml +++ b/formats/import_vcard_yahoo_connector.xml @@ -93,7 +93,7 @@ author: Nicolas Mora mail@babelouest.org - + From 0565e9d48dc003d161697fc19a99c3b8a07bfbc4 Mon Sep 17 00:00:00 2001 From: babelouest Date: Tue, 10 Feb 2015 14:43:23 -0500 Subject: [PATCH 2/3] fix bug #807 that doesn't evaluates the return value of the function convertElementToVCard when detecting the file format --- lib/connector/importcsvconnector.php | 8 ++++++-- lib/connector/importldifconnector.php | 8 ++++++-- lib/connector/importvcardconnector.php | 8 ++++++-- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/lib/connector/importcsvconnector.php b/lib/connector/importcsvconnector.php index bf726b24..821d5ae4 100644 --- a/lib/connector/importcsvconnector.php +++ b/lib/connector/importcsvconnector.php @@ -234,8 +234,12 @@ class ImportCsvConnector extends ImportConnector { return 0; } else { $element = $this->convertElementToVCard($parts[0], $titles); - $unknownElements = $element->select("X-Unknown-Element"); - return (1 - (0.5 * count($unknownElements)/count($parts[0]))); + if ($element) { + $unknownElements = $element->select("X-Unknown-Element"); + return (1 - (0.5 * count($unknownElements)/count($parts[0]))); + } else { + return 0; + } } } } diff --git a/lib/connector/importldifconnector.php b/lib/connector/importldifconnector.php index 68208098..7d16609f 100644 --- a/lib/connector/importldifconnector.php +++ b/lib/connector/importldifconnector.php @@ -207,8 +207,12 @@ class ImportLdifConnector extends ImportConnector{ return 0; } else { $element = $this->convertElementToVCard($parts[0]); - $unknownElements = $element->select("X-Unknown-Element"); - return (1 - (0.5 * count($unknownElements)/count($parts[0]))); + if ($element) { + $unknownElements = $element->select("X-Unknown-Element"); + return (1 - (0.5 * count($unknownElements)/count($parts[0]))); + } else { + return 0; + } } } } diff --git a/lib/connector/importvcardconnector.php b/lib/connector/importvcardconnector.php index 961ddb45..446b9be2 100644 --- a/lib/connector/importvcardconnector.php +++ b/lib/connector/importvcardconnector.php @@ -199,8 +199,12 @@ class ImportVCardConnector extends ImportConnector{ return 0; } else { $element = $this->convertElementToVCard($parts[0]); - $unknownElements = $element->select("X-Unknown-Element"); - return (1 - (0.5 * count($unknownElements)/count($parts[0]))); + if ($element) { + $unknownElements = $element->select("X-Unknown-Element"); + return (1 - (0.5 * count($unknownElements)/count($parts[0]))); + } else { + return 0; + } } } From 22558478921d8c8dcc4de90417c147cbc9668ac0 Mon Sep 17 00:00:00 2001 From: babelouest Date: Tue, 10 Feb 2015 16:26:11 -0500 Subject: [PATCH 3/3] fixes phone number delimiter for gmail csv import --- formats/import_csv_gmail_connector.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/formats/import_csv_gmail_connector.xml b/formats/import_csv_gmail_connector.xml index f46a60b7..fbf3f407 100644 --- a/formats/import_csv_gmail_connector.xml +++ b/formats/import_csv_gmail_connector.xml @@ -156,7 +156,7 @@ author: Nicolas Mora mail@babelouest.org - + @@ -166,7 +166,7 @@ author: Nicolas Mora mail@babelouest.org - +