summaryrefslogtreecommitdiff
path: root/lib/VNDB/Handler/Producers.pm
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2009-10-25 08:00:44 +0100
committerYorhel <git@yorhel.nl>2009-10-25 08:00:44 +0100
commit10d755bd2996dc7752dcd11c8b0c5fe8a8d347d5 (patch)
tree14893041bbc8981bb09d1581c09bf6a10309e976 /lib/VNDB/Handler/Producers.pm
parent7178f320b7b101fd7d9b482c426f9eba3702a0ab (diff)
Handler::Producers: Fixed perl warning on adding new producer
Diffstat (limited to 'lib/VNDB/Handler/Producers.pm')
-rw-r--r--lib/VNDB/Handler/Producers.pm12
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/VNDB/Handler/Producers.pm b/lib/VNDB/Handler/Producers.pm
index 4e75962b..27534e67 100644
--- a/lib/VNDB/Handler/Producers.pm
+++ b/lib/VNDB/Handler/Producers.pm
@@ -174,21 +174,19 @@ sub edit {
$frm->{relations} = $relations;
$rev = 1;
+ my $npid = $pid;
my $cid;
- if($pid) {
- ($rev, $cid) = $self->dbProducerEdit($pid, %$frm);
- } else {
- ($pid, $cid) = $self->dbProducerAdd(%$frm);
- }
+ ($rev, $cid) = $self->dbProducerEdit($pid, %$frm) if $pid;
+ ($npid, $cid) = $self->dbProducerAdd(%$frm) if !$pid;
# update reverse relations
if(!$pid && $#$relations >= 0 || $pid && $frm->{prodrelations} ne $b4{prodrelations}) {
my %old = $pid ? (map { $_->{id} => $_->{relation} } @{$p->{relations}}) : ();
my %new = map { $_->[1] => $_->[0] } @$relations;
- _updreverse($self, \%old, \%new, $pid, $cid, $rev);
+ _updreverse($self, \%old, \%new, $npid, $cid, $rev);
}
- return $self->resRedirect("/p$pid.$rev", 'post');
+ return $self->resRedirect("/p$npid.$rev", 'post');
}
}