From: Christopher Burger Date: Tue, 22 Jan 2019 15:59:45 +0000 (-0500) Subject: RT# 79352 - keep original email if all new emails are attached to other contacts... X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=5ef60116554ff9dbd01bbb4daa4e1ba098905311 RT# 79352 - keep original email if all new emails are attached to other contacts on contact replace. --- 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);