[Rt-commit] rt branch 5.0/rt-importer-skip-attr-content-updates-in-clone created. rt-5.0.1-609-g198d744918

BPS Git Server git at git.bestpractical.com
Tue Sep 7 19:52:35 UTC 2021


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "rt".

The branch, 5.0/rt-importer-skip-attr-content-updates-in-clone has been created
        at  198d74491864014ecdba23a66546dca84d621354 (commit)

- Log -----------------------------------------------------------------
commit 198d74491864014ecdba23a66546dca84d621354
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Wed Sep 8 03:18:01 2021 +0800

    No need to fix up attribute contents in clone mode
    
    The PostInflateFixup is to fix subtle dependencies of attributes
    contents on import, which is not necessary in clone mode.
    
    Even worse, as different Storable versions(e.g. 2 VS 3) can produce
    differnet output for the same data(because the output contains Storable
    version info), if we update Content here, it could create additional
    records like ContentHistory, links, etc. which will break the upcoming
    imports because of id conflicts.

diff --git a/lib/RT/Attribute.pm b/lib/RT/Attribute.pm
index 61bbadd4d7..43e75d9123 100644
--- a/lib/RT/Attribute.pm
+++ b/lib/RT/Attribute.pm
@@ -886,6 +886,7 @@ sub PostInflateFixup {
     my $self     = shift;
     my $importer = shift;
     my $spec     = shift;
+    return if $importer->{Clone};
 
     # decode UIDs to be raw dashboard IDs
     if ( $self->Name =~ /^(?:Pref-)?DashboardsInMenu$/ ) {

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


hooks/post-receive
-- 
rt


More information about the rt-commit mailing list