[Bps-public-commit] RT-Extension-MergeUsers branch, master, updated. 1.02_01-1-g617cd5c

? sunnavy sunnavy at bestpractical.com
Tue Apr 14 12:19:51 EDT 2015


The branch, master has been updated
       via  617cd5c3b5dd0b35e85442829883842d344a835b (commit)
      from  371b24e5eda213b8c8c4fb0442a5d02ad29e2e5d (commit)

Summary of changes:
 lib/RT/Extension/MergeUsers.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

- Log -----------------------------------------------------------------
commit 617cd5c3b5dd0b35e85442829883842d344a835b
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Wed Apr 15 00:15:57 2015 +0800

    return massaged address instead of empty if canonical user doesn't have email
    
    when user foo(foo at example.com) is merged into user bar(without email), if user
    send an email(from foo at example.com) to RT, we want RT to load user bar instead.
    But because RT::User::LoadByEmail calls RT::User::CanonicalizeEmailAddress,
    in previous version it actually loads first user that doesn't have email, which
    is wrong.

diff --git a/lib/RT/Extension/MergeUsers.pm b/lib/RT/Extension/MergeUsers.pm
index 2ce8a8a..5db539a 100644
--- a/lib/RT/Extension/MergeUsers.pm
+++ b/lib/RT/Extension/MergeUsers.pm
@@ -195,7 +195,7 @@ sub CanonicalizeEmailAddress {
     my $canonical_user = RT::User->new( $RT::SystemUser );
     $canonical_user->LoadByCols( EmailAddress => $address );
     return $address unless $canonical_user->id;
-    return $address unless $canonical_user->EmailAddress ne $address;
+    return $address unless $canonical_user->EmailAddress && $canonical_user->EmailAddress ne $address;
     return $canonical_user->CanonicalizeEmailAddress(
         $canonical_user->EmailAddress
     );

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


More information about the Bps-public-commit mailing list