Bug 10798 - OPAC_SEARCH_LIMIT behaves badly with search groups
Summary: OPAC_SEARCH_LIMIT behaves badly with search groups
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P4 trivial (vote)
Assignee: Martin Renvoize
QA Contact: Paul Poulain
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-28 14:48 UTC by Martin Renvoize
Modified: 2016-12-05 11:53 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 10798 - OPAC_SEARCH_LIMIT behaves badly with search groups (1.50 KB, patch)
2013-08-28 15:05 UTC, Martin Renvoize
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 10798 - OPAC_SEARCH_LIMIT behaves badly with search groups (1.58 KB, patch)
2013-10-03 02:09 UTC, Srdjan Jankovic
Details | Diff | Splinter Review
Bug 10798 - OPAC_SEARCH_LIMIT behaves badly with search groups (1.58 KB, patch)
2013-10-21 23:45 UTC, Paul Poulain
Details | Diff | Splinter Review
Bug 10798 follow-up: replacing tabs by spaces (1.39 KB, patch)
2013-10-21 23:46 UTC, Paul Poulain
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Renvoize 2013-08-28 14:48:58 UTC
The code implementing multiple PAC's by URL support as in the RFC here at http://wiki.koha-community.org/wiki/Support_for_multiple_PAC_interfaces_by_URL_RFC has been implimented for some time.

However, when the 'search by groups' feature was implemented, the above code was not taken into account, and as such if you wish to limit a search by a group as a posed to just a branch, you met with strange behaviour should you also enable the SearchMyLibraryFirst system preference.

Testplan to show Failure

1. Add a second PAC by adding an Alias to your Apache vhosts file (See below example)
2. Add a Search group to Koha using the staff client
3. Enable URL specific search limit (branch:search_group_code) to that same Apache vhosts file using a SetEnvIf (See below example)
4. Enable 'SearchMyLibraryFirst' system preference.
5. Create a user, and set that users branch.
6. Go to the 'normal' koha opac url and the search will not be limited
7. Go to the 'second' koha opac url and the search will be limited to your search group
8. Login on the 'normal' url and your search will be limited by your users branch
9. Login on the 'second' url and your search will be limited by your users branch

Step 9 is the error, if OPAC_LIMIT_OVERRIDE is set to 1 in the SetEnvIf then this should NOT be your local library branch, but actually the limit set in the Apache conf

VirtualHosts example additions

ServerName opac.your-domain.com
ServerAlias opac2.your-domain.com
SetEnvIf Host "opac2.your-domain.com" OPAC_SEARCH_LIMIT=branch:search_group_code OPAC_LIMIT_OVERRIDE=1
Comment 1 Martin Renvoize 2013-08-28 15:05:37 UTC Comment hidden (obsolete)
Comment 2 I'm just a bot 2013-09-29 05:41:47 UTC
Patch applied cleanly, go forth and signoff
Comment 3 Srdjan Jankovic 2013-10-03 02:09:24 UTC Comment hidden (obsolete)
Comment 4 Paul Poulain 2013-10-21 23:39:49 UTC
QA comment: trivial patch, but with tabs instead of spaces ! will pass it QA with a follow-up
Comment 5 Paul Poulain 2013-10-21 23:45:53 UTC
Created attachment 22237 [details] [review]
Bug 10798 - OPAC_SEARCH_LIMIT behaves badly 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 <srdjan@catalyst.net.nz>
Comment 6 Paul Poulain 2013-10-21 23:46:25 UTC
Created attachment 22238 [details] [review]
Bug 10798 follow-up: replacing tabs by spaces

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Comment 7 Galen Charlton 2014-05-05 22:14:37 UTC
Pushed to master.  Thanks, Martin!