From 07d7950b9f2b91b8cff682d73e5c95ec1037ab0f 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 --- 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 b502e92737..9f7337be62 100755 --- a/opac/opac-suggestions.pl +++ b/opac/opac-suggestions.pl @@ -66,7 +66,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