[Rt-commit] rt branch, 4.2/upgrade-from-3.6-errors, created. rt-4.1.23-18-gcaa1638

Alex Vandiver alexmv at bestpractical.com
Thu Sep 5 13:54:24 EDT 2013


The branch, 4.2/upgrade-from-3.6-errors has been created
        at  caa1638c5396fc284c1e7adcf7392a1924b8efe7 (commit)

- Log -----------------------------------------------------------------
commit 3cbd1a422e75598215860fdb056bb9f04dca6bbc
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Thu Sep 5 13:31:31 2013 -0400

    Old searches over Scrips should not pull in the new Disabled column

diff --git a/etc/upgrade/3.7.19/content b/etc/upgrade/3.7.19/content
index a7b2539..a694562 100644
--- a/etc/upgrade/3.7.19/content
+++ b/etc/upgrade/3.7.19/content
@@ -5,6 +5,7 @@ our @Final = (
     sub {
         require RT::Scrips;
         my $scrips = RT::Scrips->new( RT->SystemUser );
+        $scrips->{'with_disabled_column'} = 0;
         $scrips->Limit( FIELD => 'Description', OPERATOR => 'IS', VALUE => 'NULL' );
         $scrips->Limit( FIELD => 'Description', VALUE => '' );
         while ( my $scrip = $scrips->Next ) {

commit caa1638c5396fc284c1e7adcf7392a1924b8efe7
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Thu Sep 5 13:32:01 2013 -0400

    Using RT::Scrip->Create with an in-progress upgrade fails
    
    The ObjectScrips table, which the code will attempt to create a record
    in, does not yet exist -- and the 'Disabled' column on Scrips does not
    either.  Write an explicit call to RT::Record::Create by hand.

diff --git a/etc/upgrade/3.8.3/content b/etc/upgrade/3.8.3/content
index cbb385f..3147c87 100644
--- a/etc/upgrade/3.8.3/content
+++ b/etc/upgrade/3.8.3/content
@@ -82,13 +82,23 @@ if ( $extract_action && $extract_action->Id ) {
     );
 
     RT->Logger->debug("Adding Extract Subject Tag Scrip");
-    push @Scrips, (
-        {  Description    => "On transaction, add any tags in the transaction's subject to the ticket's subject",
-           ScripCondition => 'On Transaction',
-           ScripAction    => 'Extract Subject Tag',
-           Template       => 'Blank' 
-        },
-    );
+    push @Final, sub {
+        my $action = RT::ScripAction->new( RT->SystemUser );
+        $action->Load( 'Extract Subject Tag' );
+        my $condition = RT::ScripCondition->new( RT->SystemUser );
+        $condition->Load( 'On Transaction' );
+        my $template = RT::Template->new( RT->SystemUser );
+        $template->LoadByName( Name => 'Blank', Queue => 0 );
+        my $scrip = RT::Scrip->new( RT->SystemUser );
+        $scrip->RT::Record::Create(
+           Description    => "On transaction, add any tags in the transaction's subject to the ticket's subject",
+           ScripCondition => $condition->id,
+           ScripAction    => $action->id,
+           Template       => $template->id,
+           Stage          => 'TransactionCreate',
+           Queue          => 0,
+        );
+    };
 }
 }
 

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


More information about the Rt-commit mailing list