summaryrefslogtreecommitdiff
path: root/lib/VNDB/Handler
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2010-12-17 15:14:56 +0100
committerYorhel <git@yorhel.nl>2010-12-17 15:14:56 +0100
commit7849c8aeb4f6e6c829a128d7303f63df999a337f (patch)
tree073ec5a6c751759a57f808d60c31de76621514e8 /lib/VNDB/Handler
parent50cfb305796d1d115c408feefbe39fddf7615166 (diff)
Check for editsum = description and give an easier to understand error
The check is quite basic and you can easily get around it. It's just intended to warn about common mistakes.
Diffstat (limited to 'lib/VNDB/Handler')
-rw-r--r--lib/VNDB/Handler/Producers.pm3
-rw-r--r--lib/VNDB/Handler/Releases.pm3
-rw-r--r--lib/VNDB/Handler/VNEdit.pm4
3 files changed, 7 insertions, 3 deletions
diff --git a/lib/VNDB/Handler/Producers.pm b/lib/VNDB/Handler/Producers.pm
index d6308593..f7a46c2d 100644
--- a/lib/VNDB/Handler/Producers.pm
+++ b/lib/VNDB/Handler/Producers.pm
@@ -225,10 +225,11 @@ sub edit {
{ name => 'l_wp', required => 0, maxlength => 150, default => '' },
{ name => 'desc', required => 0, maxlength => 5000, default => '' },
{ name => 'prodrelations', required => 0, maxlength => 5000, default => '' },
- { name => 'editsum', maxlength => 5000 },
+ { name => 'editsum', required => 0, maxlength => 5000 },
{ name => 'ihid', required => 0 },
{ name => 'ilock', required => 0 },
);
+ push @{$frm->{_err}}, 'badeditsum' if !$frm->{editsum} || lc($frm->{editsum}) eq lc($frm->{desc});
if(!$frm->{_err}) {
# parse
my $relations = [ map { /^([a-z]+),([0-9]+),(.+)$/ && (!$pid || $2 != $pid) ? [ $1, $2, $3 ] : () } split /\|\|\|/, $frm->{prodrelations} ];
diff --git a/lib/VNDB/Handler/Releases.pm b/lib/VNDB/Handler/Releases.pm
index 218389ee..728a68cb 100644
--- a/lib/VNDB/Handler/Releases.pm
+++ b/lib/VNDB/Handler/Releases.pm
@@ -324,11 +324,12 @@ sub edit {
{ name => 'ani_ero', required => 0, default => 0, enum => $self->{animated} },
{ name => 'producers', required => 0, default => '' },
{ name => 'vn', maxlength => 5000 },
- { name => 'editsum', maxlength => 5000 },
+ { name => 'editsum', required => 0, maxlength => 5000 },
{ name => 'ihid', required => 0 },
{ name => 'ilock', required => 0 },
);
+ push @{$frm->{_err}}, 'badeditsum' if !$frm->{editsum} || lc($frm->{editsum}) eq lc($frm->{notes});
push @{$frm->{_err}}, [ 'released', 'required', 1 ] if !$frm->{released};
my($media, $producers, $new_vn);
diff --git a/lib/VNDB/Handler/VNEdit.pm b/lib/VNDB/Handler/VNEdit.pm
index 8ee104af..b93c544d 100644
--- a/lib/VNDB/Handler/VNEdit.pm
+++ b/lib/VNDB/Handler/VNEdit.pm
@@ -52,11 +52,13 @@ sub edit {
{ name => 'img_nsfw', required => 0, default => 0 },
{ name => 'vnrelations', required => 0, default => '', maxlength => 5000 },
{ name => 'screenshots', required => 0, default => '', maxlength => 1000 },
- { name => 'editsum', maxlength => 5000 },
+ { name => 'editsum', required => 0, maxlength => 5000 },
{ name => 'ihid', required => 0 },
{ name => 'ilock', required => 0 },
);
+ push @{$frm->{_err}}, 'badeditsum' if !$frm->{editsum} || lc($frm->{editsum}) eq lc($frm->{desc});
+
# handle image upload
my $image = _uploadimage($self, $v, $frm);