Bugzilla – Attachment 82754 Details for
Bug 21911
Scoping OPACs by branch does not work with new library groups
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21911: Fix OPAC scoping to work with new group system
Bug-21911-Fix-OPAC-scoping-to-work-with-new-group-.patch (text/plain), 3.28 KB, created by
Martin Renvoize (ashimema)
on 2018-11-29 15:40:11 UTC
(
hide
)
Description:
Bug 21911: Fix OPAC scoping to work with new group system
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2018-11-29 15:40:11 UTC
Size:
3.28 KB
patch
obsolete
>From 9df4810d7a66c13a9d70194ca390b423899a5813 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Thu, 29 Nov 2018 14:17:37 +0000 >Subject: [PATCH] Bug 21911: Fix OPAC scoping to work with new group system > >To test: > >0 - Apply patch >1 - Create a library group enabled for opac search limits and add some >libraries >2 - Check the DB (or advanced search dropdown) to get the id of the >group (using 7 as example below) >3 - Add to apache configuration (OPAC virtualhost) > SetEnv OPAC_SEARCH_LIMIT branch:multibranchlimit-7 > SetEnv OPAC_LIMIT_OVERRIDE 1 > RequestHeader add X-Koha-SetEnv "OPAC_SEARCH_LIMIT > branch:multibranchlimit-7" > RequestHeader add X-Koha-SetEnv "OPAC_LIMIT_OVERRIDE 1" >4 - Ensure OpacAddMastheadLibraryPulldown is disabled >5 - Restart all the things >6 - Visit the opac >7 - Perform a search, confirm it is scoped to the branches in the group > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > C4/Auth.pm | 4 ++-- > koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc | 6 +++++- > 2 files changed, 7 insertions(+), 3 deletions(-) > >diff --git a/C4/Auth.pm b/C4/Auth.pm >index 2435e734d3..b19197b35b 100644 >--- a/C4/Auth.pm >+++ b/C4/Auth.pm >@@ -533,8 +533,8 @@ sub get_template_and_user { > my $opac_limit_override = $ENV{'OPAC_LIMIT_OVERRIDE'}; > my $opac_name = ''; > if ( >- ( $opac_limit_override && $opac_search_limit && $opac_search_limit =~ /branch:(\w+)/ ) || >- ( $in->{'query'}->param('limit') && $in->{'query'}->param('limit') =~ /branch:(\w+)/ ) || >+ ( $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. >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc >index e9e42b28be..9466c2d9c6 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc >@@ -246,7 +246,11 @@ > [% ELSE %] > [% IF ( opac_limit_override ) %] > [% IF ( opac_search_limit ) %] >- <input name="limit" value="[% opac_search_limit | html %]" type="hidden" /> >+ [% IF ( multibranchlimit = opac_search_limit.match( 'branch:(multibranchlimit-\d+)' ) ) %] >+ <input name="branch_group_limit" value="[% multibranchlimit.0 | html %]" type="hidden" /> >+ [% ELSE %] >+ <input name="limit" value="[% opac_search_limit | html %]" type="hidden" /> >+ [% END %] > [% END %] > [% ELSE %] > [% IF ( mylibraryfirst ) %] >-- >2.19.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 21911
:
82743
|
82754
|
82767
|
82949
|
82950