0012734: phone numbers: fix update *_normalized for empty values
authorPaul Mehrer <p.mehrer@metaways.de>
Fri, 24 Feb 2017 14:38:03 +0000 (15:38 +0100)
committerPhilipp Schüle <p.schuele@metaways.de>
Tue, 28 Feb 2017 14:10:37 +0000 (15:10 +0100)
telephone numbers normalized were not updated in case
the base telephone number was set to an empty values
fixed that

https://forge.tine20.org/view.php?id=12734

Change-Id: Ibb6cf7f88a929df6386b7ceb6242fd6617d1d1c1
Reviewed-on: http://gerrit.tine20.com/customers/4265
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
Tested-by: Philipp Schüle <p.schuele@metaways.de>
tine20/Addressbook/Model/Contact.php

index 3353e49..dd9abd9 100644 (file)
@@ -393,8 +393,8 @@ class Addressbook_Model_Contact extends Tinebase_Record_Abstract
                 break;
             default:
                 // normalize telephone numbers
-                if (!empty($_value) && strpos($_name, 'tel_') === 0 && strpos($_name, '_normalized') === false) {
-                    parent::__set($_name . '_normalized', static::normalizeTelephoneNoCountry($_value));
+                if (strpos($_name, 'tel_') === 0 && strpos($_name, '_normalized') === false) {
+                    parent::__set($_name . '_normalized', (empty($_value)? $_value : static::normalizeTelephoneNoCountry($_value)));
                 }
                 break;
         }