summaryrefslogtreecommitdiff
path: root/lib/VNDB/Handler/Releases.pm
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2015-10-21 02:19:15 +0200
committerYorhel <git@yorhel.nl>2015-10-21 02:28:48 +0200
commit9cf3eef0e0a7bde10a0e1bb8c94c38b058e5121d (patch)
tree9cbd3a439316bdfe3946cc80378e4f95a9d6e6db /lib/VNDB/Handler/Releases.pm
parent718f4d0258049aa92f229c08d5ec7204dae3ffa6 (diff)
SQL: Fix editing + func.sql + triggers.sql + autocreate editing funcs
This changes quite a bit to the way the editing functions work. Because these functions are very repetitive and it's easy to keep things out of sync, I created a script to generate them automatically. I had to rename a few function and table names for consistency to make this work. Since database entries don't have a 'latest' column anymore, and since the order in which tables are updated doesn't have to be fixed, I dropped many of the SQL triggers and replaced them with a edit_committed() function which is called from edit_*_commit() and checks for stuff to be done. Don't forget to run 'make' before importing the update script.
Diffstat (limited to 'lib/VNDB/Handler/Releases.pm')
-rw-r--r--lib/VNDB/Handler/Releases.pm4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/VNDB/Handler/Releases.pm b/lib/VNDB/Handler/Releases.pm
index 1c97eced..78476db2 100644
--- a/lib/VNDB/Handler/Releases.pm
+++ b/lib/VNDB/Handler/Releases.pm
@@ -350,7 +350,7 @@ sub edit {
}
if(!$frm->{_err}) {
- my $nrev = $self->dbItemEdit(r => !$copy && $rid ? $r->{cid} : undef,
+ my $nrev = $self->dbItemEdit(r => !$copy && $rid ? ($r->{id}, $r->{rev}) : (undef, undef),
(map { $_ => $frm->{$_} } qw| type title original gtin catalog languages website released minage
notes platforms resolution editsum patch voiced freeware doujin ani_story ani_ero ihid ilock|),
vn => $new_vn,
@@ -358,7 +358,7 @@ sub edit {
media => $media,
);
- return $self->resRedirect("/r$nrev->{iid}.$nrev->{rev}", 'post');
+ return $self->resRedirect("/r$nrev->{itemid}.$nrev->{rev}", 'post');
}
}