Bugzilla – Attachment 124831 Details for
Bug 28847
Branch limits while searching should be expanded in query building and not in CGI
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28847: Remove dead code and make regex consistent
Bug-28847-Remove-dead-code-and-make-regex-consiste.patch (text/plain), 2.29 KB, created by
Nick Clemens
on 2021-09-13 11:55:43 UTC
(
hide
)
Description:
Bug 28847: Remove dead code and make regex consistent
Filename:
MIME Type:
Creator:
Nick Clemens
Created:
2021-09-13 11:55:43 UTC
Size:
2.29 KB
patch
obsolete
>From 524142fedbb4c9574d1bfd4f9fe58668e29eaa08 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Mon, 13 Sep 2021 11:53:39 +0000 >Subject: [PATCH] Bug 28847: Remove dead code and make regex consistent > >This updates the regex code to match throughout the routine and removes >code that would no longer be reached. > >Note that the code to update library name in the query descruiption was >broken before this patch, so removal does not change behaviour >--- > C4/Search.pm | 16 +++------------- > 1 file changed, 3 insertions(+), 13 deletions(-) > >diff --git a/C4/Search.pm b/C4/Search.pm >index 54b88d5d77..c448f1fd0a 100644 >--- a/C4/Search.pm >+++ b/C4/Search.pm >@@ -1472,12 +1472,12 @@ sub buildQuery { > $limit_cgi .= "&limit=" . uri_escape_utf8($this_limit); > $limit_desc .= " $this_limit"; > } >- elsif ( $this_limit =~ 'multibranchlimit|^branch' ) { >+ elsif ( $this_limit =~ '^multibranchlimit:|^branch:' ) { > $limit_cgi .= "&limit=" . uri_escape_utf8($this_limit); > $limit .= " and " if $limit || $query; > my $branchfield = C4::Context->preference('SearchLimitLibrary'); > my @branchcodes; >- if( $this_limit =~ 'multibranchlimit' ){ >+ if( $this_limit =~ '^multibranchlimit:' ){ > my ($group_id) = ( $this_limit =~ /^multibranchlimit:(.*)$/ ); > my $search_group = Koha::Library::Groups->find( $group_id ); > @branchcodes = map { $_->branchcode } $search_group->all_libraries; >@@ -1508,17 +1508,7 @@ sub buildQuery { > $limit .= " and " if $limit || $query; > $limit .= "$this_limit"; > $limit_cgi .= "&limit=" . uri_escape_utf8($this_limit); >- if ($this_limit =~ /^branch:(.+)/) { >- my $branchcode = $1; >- my $library = Koha::Libraries->find( $branchcode ); >- if (defined $library) { >- $limit_desc .= " branch:" . $library->branchname; >- } else { >- $limit_desc .= " $this_limit"; >- } >- } else { >- $limit_desc .= " $this_limit"; >- } >+ $limit_desc .= " $this_limit"; > } > } > foreach my $k (keys (%group_OR_limits)) { >-- >2.20.1
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 28847
:
123807
|
123808
|
123809
|
123830
|
123832
|
123833
|
123835
|
123836
|
123837
|
123841
|
124574
|
124575
|
124576
|
124577
|
124797
|
124831
|
125017
|
125018
|
125019
|
125020
|
125021
|
125022
|
126827