[Rt-commit] rt branch, 4.2/disabled-article-cfs, created. rt-4.2.1-49-g44c490c

Kevin Falcone falcone at bestpractical.com
Thu Dec 5 11:49:35 EST 2013


The branch, 4.2/disabled-article-cfs has been created
        at  44c490cbdcde06987f9fff4ce975587752acfcde (commit)

- Log -----------------------------------------------------------------
commit 44c490cbdcde06987f9fff4ce975587752acfcde
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Thu Dec 5 11:47:24 2013 -0500

    Clone of the 4.0.19 upgrade script from 9d60fbcd5
    
    In case you had already come to 4.2.1, you wouldn't have run any of the
    scripts that fix disabled OCFVs or CFs.  This should be a no-op for most
    people.

diff --git a/etc/upgrade/4.2.2/content b/etc/upgrade/4.2.2/content
new file mode 100644
index 0000000..20571ab
--- /dev/null
+++ b/etc/upgrade/4.2.2/content
@@ -0,0 +1,29 @@
+use strict;
+use warnings;
+
+our @Initial = (
+    sub {
+        use RT::CustomFields;
+        my $cfs = RT::CustomFields->new(RT->SystemUser);
+        $cfs->{'find_disabled_rows'} = 1;
+        $cfs->Limit( FIELD => 'LookupType', VALUE => 'RT::FM::Class-RT::FM::Article' );
+        while ( my $cf = $cfs->Next ) {
+            my ($ret, $msg) = $cf->__Set( Field => 'LookupType', Value => 'RT::Class-RT::Article' );
+            RT->Logger->warnings("Update Custom Field LookupType for CF.".$cf->Id." $msg");
+        }
+        return 1;
+    },
+
+    sub {
+        use RT::ObjectCustomFieldValues;
+        my $ocfvs = RT::ObjectCustomFieldValues->new(RT->System);
+        $ocfvs->{'find_expired_rows'} = 1;
+        $ocfvs->Limit( FIELD => 'ObjectType', VALUE => 'RT::FM::Article' );
+        while ( my $ocfv = $ocfvs->Next ) {
+            my ($ret, $msg) = $ocfv->__Set( Field => 'ObjectType', Value => 'RT::Article' );
+            RT->Logger->warning("Updated CF ".$ocfv->__Value('CustomField')." Value for Article ".$ocfv->__Value('ObjectId'));
+        }
+        return 1;
+    },
+);
+

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


More information about the rt-commit mailing list