diff options
author | Mark Wells <mark@freeside.biz> | 2013-07-18 11:51:21 -0700 |
---|---|---|
committer | Mark Wells <mark@freeside.biz> | 2013-07-18 11:51:21 -0700 |
commit | 3fa4e563b63c858ed8ab518bf6a7286622424435 (patch) | |
tree | bee3786120a03ca3c64b06e70cc1882682653957 /FS/FS/TicketSystem.pm | |
parent | 0fd6e4b7e096b1e53763b46656d392b04c802158 (diff) |
allow changing template on system scrips, #18184
Diffstat (limited to 'FS/FS/TicketSystem.pm')
-rw-r--r-- | FS/FS/TicketSystem.pm | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/FS/FS/TicketSystem.pm b/FS/FS/TicketSystem.pm index 96980e9..c1c69fa 100644 --- a/FS/FS/TicketSystem.pm +++ b/FS/FS/TicketSystem.pm @@ -209,7 +209,7 @@ sub _upgrade_data { while (my $item = $search->Next) { my ($c, $a, $t) = map {lc $item->$_->Name} ('ScripConditionObj', 'ScripActionObj', 'TemplateObj'); - if ( exists $scrip{$c}{$a}{$t} and $item->Creator == 1 ) { + if ( exists $scrip{$c}{$a} and $item->Creator == 1 ) { warn "Deleting duplicate scrip $c $a [$t]\n"; my ($val, $msg) = $item->Delete; warn "error deleting scrip: $msg\n" if !$val; @@ -220,7 +220,7 @@ sub _upgrade_data { warn "error deleting scrip: $msg\n" if !$val; } else { - $scrip{$c}{$a}{$t} = $item->id; + $scrip{$c}{$a} = $item->id; } } my $Scrip = RT::Scrip->new($CurrentUser); @@ -229,8 +229,8 @@ sub _upgrade_data { my ($c, $a, $t) = map lc, @{ $s }{'ScripCondition', 'ScripAction', 'Template'}; - if ( exists($scrip{$c}{$a}{$t}) ) { - $Scrip->Load( $scrip{$c}{$a}{$t} ); + if ( exists($scrip{$c}{$a}) ) { + $Scrip->Load( $scrip{$c}{$a} ); } else { # need to create it if ( !exists($condition{$c}) ) { |