X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=rt%2Fetc%2Fupgrade%2F3.8.8%2Fcontent;h=50b331441108febe224ce6b79e219e2d4278764c;hp=ee1943304d1a7e0735df69f7022237f7d315f179;hb=9aee669886202be7035e6c6049fc71bc99dd3013;hpb=e70abd21bab68b23488f7ef1ee2e693a3b365691 diff --git a/rt/etc/upgrade/3.8.8/content b/rt/etc/upgrade/3.8.8/content index ee1943304..50b331441 100644 --- a/rt/etc/upgrade/3.8.8/content +++ b/rt/etc/upgrade/3.8.8/content @@ -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" @@ -26,10 +29,10 @@ 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; }