[Bps-public-commit] RT-Extension-MergeUsers branch, master, updated. 1.04-1-g9975595

? sunnavy sunnavy at bestpractical.com
Wed Feb 5 16:46:56 EST 2020


The branch, master has been updated
       via  9975595c4d7a4b7498c4dfe225a8592c76e103c9 (commit)
      from  2da893ce99e60540c1ba846cc936652c1eaaea59 (commit)

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

- Log -----------------------------------------------------------------
commit 9975595c4d7a4b7498c4dfe225a8592c76e103c9
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Thu Feb 6 05:41:38 2020 +0800

    Fix the logic of "skipping duplicated records" in users collections
    
    Previously the skip logic was wrongly applied to merged users only,
    which is incorret, which could result duplicates if merged users come
    first and then the main user.
    
    This commit applies the logic to all the users.

diff --git a/lib/RT/Extension/MergeUsers.pm b/lib/RT/Extension/MergeUsers.pm
index c1bb825..452a617 100644
--- a/lib/RT/Extension/MergeUsers.pm
+++ b/lib/RT/Extension/MergeUsers.pm
@@ -421,12 +421,11 @@ sub AddRecord {
             my $user = RT::User->new( $record->CurrentUser );
             $user->LoadByCols( id => $effective_id->Content );
             if ( $user->id ) {
-                return if $self->{seen_users}{ $user->id };
                 $record = $user;
             }
         }
     }
-    $self->{seen_users}{ $record->id }++;
+    return if $self->{seen_users}{ $record->id }++;
     return $self->SUPER::AddRecord($record);
 }
 

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


More information about the Bps-public-commit mailing list