diff options
author | cvs2git <cvs2git> | 2010-12-27 00:04:45 +0000 |
---|---|---|
committer | cvs2git <cvs2git> | 2010-12-27 00:04:45 +0000 |
commit | c82d349f864e6bd9f96fd1156903bc1f7193a203 (patch) | |
tree | e117a87533656110b6acd56fc0ca64289892a9f5 /rt/etc/upgrade/3.8.4/content | |
parent | 74e058c8a010ef6feb539248a550d0bb169c1e94 (diff) |
This commit was manufactured by cvs2svn to create tag 'TORRUS_1_0_9'.TORRUS_1_0_9
Diffstat (limited to 'rt/etc/upgrade/3.8.4/content')
-rw-r--r-- | rt/etc/upgrade/3.8.4/content | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/rt/etc/upgrade/3.8.4/content b/rt/etc/upgrade/3.8.4/content deleted file mode 100644 index be5a6bf39..000000000 --- a/rt/etc/upgrade/3.8.4/content +++ /dev/null @@ -1,59 +0,0 @@ - -@Final = ( - sub { - $RT::Logger->debug("Going to correct arguments of NotifyGroup actions if you have any"); - use strict; - - my $actions = RT::ScripActions->new( $RT::SystemUser ); - $actions->Limit( - FIELD => 'ExecModule', - VALUE => 'NotifyGroup', - ); - $actions->Limit( - FIELD => 'ExecModule', - VALUE => 'NotifyGroupAsComment', - ); - - my $converter = sub { - my $arg = shift; - my @res; - foreach my $r ( @{ $arg } ) { - my $obj; - next unless $r->{'Type'}; - if( lc $r->{'Type'} eq 'user' ) { - $obj = RT::User->new( $RT::SystemUser ); - } elsif ( lc $r->{'Type'} eq 'group' ) { - $obj = RT::Group->new( $RT::SystemUser ); - } else { - next; - } - $obj->Load( $r->{'Instance'} ); - my $id = $obj->id; - next unless( $id ); - - push @res, $id; - } - - return join ',', @res; - }; - - require Storable; - while ( my $action = $actions->Next ) { - my $argument = $action->Argument; - my $new = ''; - local $@; - if ( my $struct = eval { Storable::thaw( $argument ) } ) { - $new = $converter->( $struct ); - } else { - $new = join /, /, grep length, split /[^0-9]+/, $argument; - } - next if $new eq $argument; - - my ($status, $msg) = $action->__Set( Field => 'Argument', Value => $new ); - $RT::Logger->warning( "Couldn't change argument value of the action: $msg" ) - unless $status; - } - }, -); - - |