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");
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'));
31 my $scrips = RT::Scrips->new( RT->SystemUser );
32 $scrips->{'find_disabled_rows'} = 1;
33 $scrips->Limit( FIELD => 'Disabled', VALUE => 1 );;
34 while ( my $scrip = $scrips->Next ) {
35 my $id = $scrip->Template;
37 $RT::Logger->info('Template column for scrip #'. $scrip->id .' already contains characters');
43 my $template = RT::Template->new( RT->SystemUser );
44 $template->Load( $id );
45 unless ( $template->id ) {
46 $RT::Logger->error("Scrip #". $scrip->id ." has template set to #$id, but it's not in DB, setting it 'Blank'");
49 $name = $template->Name;
52 my ($status, $msg) = $scrip->_Set( Field => 'Template', Value => $name );
54 $RT::Logger->error("Couldn't set template: $msg");