[Rt-commit] rt branch, 4.4/shredder-set-owner-txns, created. rt-4.4.4-194-g7e5f7277b2

? sunnavy sunnavy at bestpractical.com
Fri Dec 18 17:00:43 EST 2020


The branch, 4.4/shredder-set-owner-txns has been created
        at  7e5f7277b23151e5a9743295e4c62db85e02de0a (commit)

- Log -----------------------------------------------------------------
commit 7e5f7277b23151e5a9743295e4c62db85e02de0a
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Sat Dec 19 05:51:00 2020 +0800

    Remove SetOwner rows in transaction history on user shred
    
    This is for data consistency, and rt-validator would report if they were
    not removed.

diff --git a/lib/RT/Principal.pm b/lib/RT/Principal.pm
index 3f0c8416c8..37dd0f8dde 100644
--- a/lib/RT/Principal.pm
+++ b/lib/RT/Principal.pm
@@ -845,6 +845,15 @@ sub __DependsOn {
         push( @$list, $objs );
     }
 
+    # Ticket's special Set Owner txns
+    for my $column ( qw(OldValue NewValue) ) {
+        my $objs = RT::Transactions->new( $self->CurrentUser );
+        $objs->Limit( FIELD => $column, VALUE => $self->Id );
+        $objs->Limit( FIELD => 'Type', VALUE => 'Set' );
+        $objs->Limit( FIELD => 'Field', VALUE => 'Owner' );
+        push( @$list, $objs );
+    }
+
     $deps->_PushDependencies(
         BaseObject => $self,
         Flags => RT::Shredder::Constants::DEPENDS_ON,

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


More information about the rt-commit mailing list