[% FOREACH ERROR IN ERRORS %]
<div class="alert">
There was a problem with this operation:
- [% IF ( ERROR.tagsdisabled ) %]
- Sorry, tags are not enabled on this system.
- [% ELSIF ( ERROR.badparam ) %]
+ [% IF ( ERROR.badparam ) %]
ERROR: illegal parameter [% ERROR.badparam | html %]
[% ELSIF ( ERROR.login ) %]
ERROR: You must log in to complete that action.
use C4::Auth qw(:DEFAULT check_cookie_auth);
use C4::Context;
use C4::Debug;
-use C4::Output qw(:html :ajax pagination_bar);
+use C4::Output qw(:html :ajax );
use C4::Scrubber;
use C4::Biblio;
use C4::Items qw(GetItemsInfo GetHiddenItemnumbers);
my $is_ajax = is_ajax();
my $openadds = C4::Context->preference('TagsModeration') ? 0 : 1;
my $query = ($is_ajax) ? &ajax_auth_cgi({}) : CGI->new();
-unless (C4::Context->preference('TagsEnabled')) {
- push @errors, {+ tagsdisabled=>1 };
- push @globalErrorIndexes, $#errors;
-} else {
- foreach ($query->param) {
- if (/^newtag(.*)/) {
- my $biblionumber = $1;
- unless ($biblionumber =~ /^\d+$/) {
- $debug and warn "$_ references non numerical biblionumber '$biblionumber'";
- push @errors, {+'badparam' => $_ };
- push @globalErrorIndexes, $#errors;
- next;
- }
- $newtags{$biblionumber} = $query->param($_);
- } elsif (/^del(\d+)$/) {
- push @deltags, $1;
- }
- }
+foreach ($query->param) {
+ if (/^newtag(.*)/) {
+ my $biblionumber = $1;
+ unless ($biblionumber =~ /^\d+$/) {
+ $debug and warn "$_ references non numerical biblionumber '$biblionumber'";
+ push @errors, {+'badparam' => $_ };
+ push @globalErrorIndexes, $#errors;
+ next;
+ }
+ $newtags{$biblionumber} = $query->param($_);
+ } elsif (/^del(\d+)$/) {
+ push @deltags, $1;
+ }
}
my $add_op = (scalar(keys %newtags) + scalar(@deltags)) ? 1 : 0;
});
}
+unless ( C4::Context->preference('TagsEnabled') ) {
+ print $query->redirect("/cgi-bin/koha/errors/404.pl");
+ exit;
+}
+
if ($add_op) {
unless ($loggedinuser) {
push @errors, {+'login' => 1 };