Merge branch 'master' of git.freeside.biz:/home/git/freeside
[freeside.git] / rt / etc / upgrade / 3.8.8 / content
index ee19433..50b3314 100644 (file)
@@ -1,7 +1,10 @@
-@Initial = (
+use strict;
+use warnings;
+
+our @Initial = (
     sub {
         # make sure global CFs are not applied to local objects
-        my $ocfs = RT::ObjectCustomFields->new( $RT::SystemUser );
+        my $ocfs = RT::ObjectCustomFields->new( RT->SystemUser );
         $ocfs->Limit( FIELD => 'ObjectId', OPERATOR => '!=', VALUE => 0 );
         my $alias = $ocfs->Join(
             FIELD1 => 'CustomField',
@@ -15,7 +18,7 @@
     },
     sub {
         # sort SortOrder
-        my $sth = $RT::Handle->dbh->prepare(
+        my $sth = RT->DatabaseHandle->dbh->prepare(
             "SELECT cfs.LookupType, ocfs.id"
             ." FROM ObjectCustomFields ocfs, CustomFields cfs"
             ." WHERE cfs.id = ocfs.CustomField"
         my ($i, $prev_type) = (0, '');
         while ( my ($lt, $id) = $sth->fetchrow_array ) {
             $i = 0 if $prev_type ne $lt;
-            my $ocf = RT::ObjectCustomField->new( $RT::SystemUser );
+            my $ocf = RT::ObjectCustomField->new( RT->SystemUser );
             $ocf->Load( $id );
             my ($status, $msg) = $ocf->SetSortOrder( $i++ );
-            $RT::Logger->warning("Couldn't set SortOrder: $msg")
+            RT->Logger->warning("Couldn't set SortOrder: $msg")
                 unless $status;
             $prev_type = $lt;
         }