Bugzilla – Attachment 18229 Details for
Bug 10281
Search domains do not seem to work
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10281: searching for a search domain fails
Bug-10281-searching-for-a-search-domain-fails.patch (text/plain), 2.95 KB, created by
Jared Camins-Esakov
on 2013-05-18 20:38:17 UTC
(
hide
)
Description:
Bug 10281: searching for a search domain fails
Filename:
MIME Type:
Creator:
Jared Camins-Esakov
Created:
2013-05-18 20:38:17 UTC
Size:
2.95 KB
patch
obsolete
>From ec7e28fb57bb05f4292e0765f7e4b95b4f01a4fd Mon Sep 17 00:00:00 2001 >From: Jared Camins-Esakov <jcamins@cpbibliography.com> >Date: Sat, 18 May 2013 09:09:23 -0400 >Subject: [PATCH] Bug 10281: searching for a search domain fails > >For reasons I cannot fathom, the split() in handling multi-branch >limits was not coming up with a valid search group code. Replacing >the split() with a substr() and creating the CGI parameter as a string >rather than as an arrayref fixes the problem. This problem may not >affect all installations, since I tested this exact feature just under >two months ago and it worked fine, and none of the relevant code has >been changed since then that I can see. > >To test: >1) Create search group, and add at least one library to it, in > /cgi-bin/koha/admin/branches.pl >2) Apply patch >3) Try doing a search limited to your search group, making sure that > the search will match items that belong to a library in the search > group >4) Sign off >--- > catalogue/search.pl | 3 ++- > opac/opac-search.pl | 10 +++++++--- > 2 files changed, 9 insertions(+), 4 deletions(-) > >diff --git a/catalogue/search.pl b/catalogue/search.pl >index 8624b3b..258c381 100755 >--- a/catalogue/search.pl >+++ b/catalogue/search.pl >@@ -412,7 +412,8 @@ my @operands = $cgi->param('q'); > my @limits = $cgi->param('limit'); > > if($params->{'multibranchlimit'}) { >- push @limits, '('.join( " or ", map { "branch: $_ " } @{ GetBranchesInCategory( $params->{'multibranchlimit'} ) } ).')'; >+ my $multibranch = '('.join( " or ", map { "branch: $_ " } @{ GetBranchesInCategory( $params->{'multibranchlimit'} ) } ).')'; >+ push @limits, $multibranch if ($multibranch ne '()'); > } > > my $available; >diff --git a/opac/opac-search.pl b/opac/opac-search.pl >index 363a11e..b527745 100755 >--- a/opac/opac-search.pl >+++ b/opac/opac-search.pl >@@ -65,10 +65,13 @@ my $cgi = new CGI; > > my $branch_group_limit = $cgi->param("branch_group_limit"); > if ( $branch_group_limit ) { >- if ( $branch_group_limit =~ /^multibranchlimit/ ) { >+ if ( $branch_group_limit =~ /^multibranchlimit-/ ) { >+ # For search groups we are going to convert this branch_group_limit CGI >+ # parameter into a multibranchlimit CGI parameter for the purposes of >+ # actually performing the query > $cgi->param( > -name => 'multibranchlimit', >- -values => [ ( split( 'multibranchlimit-', $branch_group_limit ) )[1] ] >+ -values => substr($branch_group_limit, 17) > ); > } else { > $cgi->append( >@@ -403,7 +406,8 @@ my @limits = $cgi->param('limit'); > @limits = map { uri_unescape($_) } @limits; > > if($params->{'multibranchlimit'}) { >- push @limits, '('.join( " or ", map { "branch: $_ " } @{ GetBranchesInCategory( $params->{'multibranchlimit'} ) } ).')'; >+ my $multibranch = '('.join( " or ", map { "branch: $_ " } @{ GetBranchesInCategory( $params->{'multibranchlimit'} ) } ).')'; >+ push @limits, $multibranch if ($multibranch ne '()'); > } > > my $available; >-- >1.7.9.5
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 10281
:
18227
|
18229
|
18234
|
18236