[Rt-commit] rt branch 5.0/speed-up-importer updated. rt-5.0.3-139-gc18bce40f8

BPS Git Server git at git.bestpractical.com
Mon Nov 14 15:29:21 UTC 2022


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/speed-up-importer has been updated
       via  c18bce40f843c0286dcda77562739aa590a26b4c (commit)
      from  51bfaca09c9a5a140006619176c6ff5e7d4296a5 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit c18bce40f843c0286dcda77562739aa590a26b4c
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Fri Nov 11 04:03:53 2022 +0800

    Serialize/Import bookmarks correctly
    
    Previously the ticket ids were not serialized to UIDs.

diff --git a/lib/RT/Attribute.pm b/lib/RT/Attribute.pm
index 15e3ce6f6c..1bbc32f47b 100644
--- a/lib/RT/Attribute.pm
+++ b/lib/RT/Attribute.pm
@@ -989,6 +989,17 @@ sub PostInflateFixup {
         }
         $self->SetContent($content);
     }
+    elsif ( $self->Name eq 'Bookmarks' ) {
+        my $content = $self->Content;
+        my @ids;
+        for my $uid (@$content) {
+            if ( my $ticket = $importer->LookupObj($$uid) ) {
+                push @ids, $ticket->Id;
+            }
+        }
+        $content = { map { $_ => 1 } @ids };
+        $self->SetContent($content);
+    }
 }
 
 sub PostInflate {
@@ -1057,6 +1068,11 @@ sub Serialize {
 
         $store{Content} = $self->_SerializeContent($content);
     }
+    elsif ( $self->Name eq 'Bookmarks' ) {
+        my $content = $self->Content;
+        $content = [ map { \( join '-', 'RT::Ticket', $RT::Organization, $_ ) } keys %$content ];
+        $store{Content} = $self->_SerializeContent($content);
+    }
 
     return %store;
 }

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

Summary of changes:
 lib/RT/Attribute.pm | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)


hooks/post-receive
-- 
rt


More information about the rt-commit mailing list