Merge branch 'master' of git.freeside.biz:/home/git/freeside
[freeside.git] / rt / etc / upgrade / 4.0.19 / content
1 use strict;
2 use warnings;
3
4 our @Initial = (
5     sub {
6         use RT::CustomFields;
7         my $cfs = RT::CustomFields->new(RT->SystemUser);
8         $cfs->{'find_disabled_rows'} = 1;
9         $cfs->Limit( FIELD => 'LookupType', VALUE => 'RT::FM::Class-RT::FM::Article' );
10         while ( my $cf = $cfs->Next ) {
11             my ($ret, $msg) = $cf->__Set( Field => 'LookupType', Value => 'RT::Class-RT::Article' );
12             RT->Logger->warning("Update Custom Field LookupType for CF.".$cf->Id." $msg");
13         }
14         return 1;
15     },
16
17     sub {
18         use RT::ObjectCustomFieldValues;
19         my $ocfvs = RT::ObjectCustomFieldValues->new(RT->System);
20         $ocfvs->{'find_expired_rows'} = 1;
21         $ocfvs->Limit( FIELD => 'ObjectType', VALUE => 'RT::FM::Article' );
22         while ( my $ocfv = $ocfvs->Next ) {
23             my ($ret, $msg) = $ocfv->__Set( Field => 'ObjectType', Value => 'RT::Article' );
24             RT->Logger->warning("Updated CF ".$ocfv->__Value('CustomField')." Value for Article ".$ocfv->__Value('ObjectId'));
25         }
26         return 1;
27     },
28 );
29