From b2484b22f7d08d215d615df056c2d007fab0c151 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Wed, 28 Aug 2013 16:00:37 +0100 Subject: [PATCH] Bug 10798: make OPAC_SEARCH_LIMIT behaves better with search groups Since the addition of search groups to Koha, the branch limiting parameter in multiple PAC by URL support should also support limiting by these search groups. This patch adds this ability. Signed-off-by: Srdjan Signed-off-by: Galen Charlton --- C4/Auth.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/C4/Auth.pm b/C4/Auth.pm index fe4a9b13c1..3da27d27e2 100644 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -393,7 +393,11 @@ sub get_template_and_user { my $opac_search_limit = $ENV{'OPAC_SEARCH_LIMIT'}; my $opac_limit_override = $ENV{'OPAC_LIMIT_OVERRIDE'}; my $opac_name = ''; - if (($opac_search_limit && $opac_search_limit =~ /branch:(\w+)/ && $opac_limit_override) || ($in->{'query'}->param('limit') && $in->{'query'}->param('limit') =~ /branch:(\w+)/)){ + if ( + ($opac_limit_override && $opac_search_limit && $opac_search_limit =~ /branch:(\w+)/) || + ($in->{'query'}->param('limit') && $in->{'query'}->param('limit') =~ /branch:(\w+)/) || + ($in->{'query'}->param('multibranchlimit') && $in->{'query'}->param('multibranchlimit') =~ /multibranchlimit-(\w+)/) + ) { $opac_name = $1; # opac_search_limit is a branch, so we use it. } elsif ( $in->{'query'}->param('multibranchlimit') ) { $opac_name = $in->{'query'}->param('multibranchlimit'); -- 2.39.5