[freeside-commits] branch master updated. 795a733714d398d4a3d427de1448b7daaf92399d

Jonathan Prykop jonathan at 420.am
Thu Feb 5 15:05:54 PST 2015


The branch, master has been updated
       via  795a733714d398d4a3d427de1448b7daaf92399d (commit)
      from  f4def30fba7da2daed58df35b80ffce0e9d0c776 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 795a733714d398d4a3d427de1448b7daaf92399d
Author: Jonathan Prykop <jonathan at freeside.biz>
Date:   Thu Feb 5 17:05:03 2015 -0600

    RT#30248: Unable to remove phone number from contact (added whitespace stripping

diff --git a/FS/FS/contact.pm b/FS/FS/contact.pm
index 589fc7c..89bfb74 100644
--- a/FS/FS/contact.pm
+++ b/FS/FS/contact.pm
@@ -452,8 +452,11 @@ sub replace {
              );
     my $contact_phone = qsearchs('contact_phone', \%cp);
 
+    my $pv = $self->get($pf);
+	$pv =~ s/\s//g;
+
     #if new value is empty, delete old entry
-    if (!$self->get($pf)) {
+    if (!$pv) {
       if ($contact_phone) {
         $error = $contact_phone->delete;
         if ( $error ) {
@@ -466,7 +469,7 @@ sub replace {
 
     $contact_phone ||= new FS::contact_phone \%cp;
 
-    my %cpd = _parse_phonestring( $self->get($pf) );
+    my %cpd = _parse_phonestring( $pv );
     $contact_phone->set( $_ => $cpd{$_} ) foreach keys %cpd;
 
     my $method = $contact_phone->contactphonenum ? 'replace' : 'insert';

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/contact.pm |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)




More information about the freeside-commits mailing list