From 8aabf8ca53f590f3b4fcc0247779b03f50b26eaa Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 2 Jan 2020 11:38:18 +0100 Subject: [PATCH] Bug 24327: Redirect to the login form if AnonSuggestion misconfigured Test plan: Turn on AnonSuggestion but set AnonymousPatron to an invalid value Go to /cgi-bin/koha/opac-suggestions.pl?op=add => You see the login form Signed-off-by: hc Signed-off-by: Katrin Fischer Signed-off-by: Martin Renvoize Signed-off-by: Joy Nelson --- opac/opac-suggestions.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opac/opac-suggestions.pl b/opac/opac-suggestions.pl index 8f792cd98f..c616f59033 100755 --- a/opac/opac-suggestions.pl +++ b/opac/opac-suggestions.pl @@ -63,7 +63,7 @@ my ( $template, $borrowernumber, $cookie, @messages ); my $deleted = $input->param('deleted'); my $submitted = $input->param('submitted'); -if ( C4::Context->preference("AnonSuggestions") or ( C4::Context->preference("OPACViewOthersSuggestions") and $op eq 'else' ) ) { +if ( ( C4::Context->preference("AnonSuggestions") and Koha::Patrons->find( C4::Context->preference("AnonymousPatron") ) ) or ( C4::Context->preference("OPACViewOthersSuggestions") and $op eq 'else' ) ) { ( $template, $borrowernumber, $cookie ) = get_template_and_user( { template_name => "opac-suggestions.tt", -- 2.39.5