diff options
author | Christopher Burger <burgerc@freeside.biz> | 2019-01-22 10:59:45 -0500 |
---|---|---|
committer | Christopher Burger <burgerc@freeside.biz> | 2019-01-22 10:59:45 -0500 |
commit | 5ef60116554ff9dbd01bbb4daa4e1ba098905311 (patch) | |
tree | d325ccfd961f6287550508ac2dc6a271d164b073 | |
parent | 438c813bf5a71dc6c09396acac85656b15139adf (diff) |
RT# 79352 - keep original email if all new emails are attached to other contacts on contact replace.
-rw-r--r-- | FS/FS/contact.pm | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/FS/FS/contact.pm b/FS/FS/contact.pm index f59fef927..13f07a283 100644 --- a/FS/FS/contact.pm +++ b/FS/FS/contact.pm @@ -468,6 +468,13 @@ sub replace { } + ## were all emails duplicates? if so reset original emails + if (scalar @contact_emails < 1 && scalar (keys %contact_nums) > 1) { + foreach (qsearch('contact_email', {'contactnum' => $self->contactnum})) { + push @contact_emails, $_->emailaddress; + } + } + my $emails = join(' , ', @contact_emails); $self->emailaddress($emails); |