Bug 37244: Facets should not impact library pulldown.

When parsing the branch limits the regular expression matches
parameters that contains the substring "branch:" rather than the prefix
"^branch:". Consequently, both prefixes homebranch: and holdingbranch:
triggers the branch limit.

Test plan:

- Activate the system preference  IntranetAddMastheadLibraryPulldown.
- In staff interface:
  - Perform a catalogue search (e.g. "book").
  - Click on a facet for holding library or home library
    (e.g. "Fairview").
  - Click on the "more options" icon in the search box and make sure
    that "All libraries" is selected.
- Activate the system preference  OpacAddMastheadLibraryPulldown
- In opac:
  - Perform a catalogue search (e.g. "book").
  - Click on a facet for holding library or home library
    (e.g. "Fairview").
  - Make sure "All libraries" is still selected in the dropdown next
    to the search input.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Andreas Jonsson 2024-07-03 13:15:40 +00:00 committed by Katrin Fischer
parent a84a5fc7d0
commit a6457c14aa
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
2 changed files with 4 additions and 4 deletions

View File

@ -554,9 +554,9 @@ 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-]+)/ ) ||
( $in->{'query'}->param('limit') && $in->{'query'}->param('limit') =~ /multibranchlimit:(\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('limit') && $in->{'query'}->param('limit') =~ /^multibranchlimit:(\w+)/ )
) {
$opac_name = $1; # opac_search_limit is a branch, so we use it.
} elsif ( $in->{'query'}->param('multibranchlimit') ) {

View File

@ -243,7 +243,7 @@ my @search_groups =
my $branch_limit = '';
my $limit_param = $cgi->param('limit');
if ( $limit_param and $limit_param =~ /branch:([\w-]+)/ ) {
if ( $limit_param and $limit_param =~ /^branch:([\w-]+)/ ) {
$branch_limit = $1;
}