Bugzilla – Attachment 33194 Details for
Bug 13189
Patron card creator patron search browse by last name broken by extended attributes
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13189 - Patron card creator patron search browse by last name broken by extended attributes
Bug-13189---Patron-card-creator-patron-search-brow.patch (text/plain), 4.32 KB, created by
Kyle M Hall (khall)
on 2014-11-04 11:28:45 UTC
(
hide
)
Description:
Bug 13189 - Patron card creator patron search browse by last name broken by extended attributes
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2014-11-04 11:28:45 UTC
Size:
4.32 KB
patch
obsolete
>From 92de480660f7d02e846f6637a219a1a3269f62a1 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Mon, 3 Nov 2014 09:31:27 -0500 >Subject: [PATCH] Bug 13189 - Patron card creator patron search browse by last name broken by extended attributes > >The browse by last name letters on the patron search for the patron card >creator doesn't work quite right. If extended patron attributes are >disabled, it works fine, but if they are enabled, they are searched even >when using the browse last name. Thus, if a searchable attribute has a >"D" in it, and one clicks the "D" link for the last name browser, that >patron will show even if he or she has no "D" in his or her hame! > >Test Plan: >1) Enable extended patron attributes >2) Add a new searchable patron attribute >3) Create a new patron with the last name "Ace" >4) Add the value "D" to the attribute for this patron >5) Browse to the patron card maker, start a new patron batch >6) Click "Add item(s)" to bring up the patron search >7) Click the letter "D" in the patron search box >8) Note that "Ace" shows in the results list >9) Apply this patch >10) Repeat step 7 >11) Note that "Ace" no longer shows in the results list >12) Perform a regular search by putting the letter "D" in the "Name:" > field, and hit the "Search" button >13) Note this time the results *do* have Ace in them >--- > C4/Members.pm | 4 ++-- > .../prog/en/modules/patroncards/members-search.tt | 2 +- > patroncards/members-search.pl | 5 +++-- > 3 files changed, 6 insertions(+), 5 deletions(-) > >diff --git a/C4/Members.pm b/C4/Members.pm >index 0978078..f433ca7 100644 >--- a/C4/Members.pm >+++ b/C4/Members.pm >@@ -198,7 +198,7 @@ sub _express_member_find { > } > > sub Search { >- my ( $filter, $orderby, $limit, $columns_out, $search_on_fields, $searchtype ) = @_; >+ my ( $filter, $orderby, $limit, $columns_out, $search_on_fields, $searchtype, $not_attributes ) = @_; > > my $search_string; > my $found_borrower; >@@ -232,7 +232,7 @@ sub Search { > } > } > >- if ( !$found_borrower && C4::Context->preference('ExtendedPatronAttributes') && $search_string ) { >+ if ( !$found_borrower && C4::Context->preference('ExtendedPatronAttributes') && $search_string && !$not_attributes ) { > my $matching_records = C4::Members::Attributes::SearchIdMatchingAttribute($search_string); > if(scalar(@$matching_records)>0) { > if ( my $fr = ref $filter ) { >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/members-search.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/members-search.tt >index 50289c1..b0e7702 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/members-search.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/members-search.tt >@@ -50,7 +50,7 @@ function add_item(borrowernum,batch_id,type_id){ > <div class="browse"> > Browse by last name: > [% FOREACH letter IN alphabet.split(' ') %] >- <a href="/cgi-bin/koha/patroncards/members-search.pl?member=[% letter %]&batch_id=[% batch_id %]">[% letter %]</a> >+ <a href="/cgi-bin/koha/patroncards/members-search.pl?not_attributes=1&member=[% letter %]&batch_id=[% batch_id %]">[% letter %]</a> > [% END %] > </div> > >diff --git a/patroncards/members-search.pl b/patroncards/members-search.pl >index 8d46417..b7df29d 100755 >--- a/patroncards/members-search.pl >+++ b/patroncards/members-search.pl >@@ -35,6 +35,7 @@ my $resultsperpage = $cgi->param('resultsperpage')||C4::Context->preference("Pat > my $category = $cgi->param('category') || undef; > my $member = $cgi->param('member') || ''; > my $orderby = $cgi->param('orderby') || undef; >+my $not_attributes = $cgi->param('not_attributes') || undef; > > my @categories=C4::Category->all; > my %categories_display; >@@ -72,8 +73,8 @@ $member =~ s/,//g; #remove any commas from search string > $member =~ s/\*/%/g; > > if ($member || $category) { >- my $results = $category ? Search({''=>$member, categorycode=>$category}, $orderby) >- : Search($member, $orderby); >+ my $results = $category ? Search({''=>$member, categorycode=>$category}, $orderby, undef, undef, undef, undef, $not_attributes ) >+ : Search($member, $orderby, undef, undef, undef, undef, $not_attributes); > my $count = $results ? @$results : 0; > > my @resultsdata = (); >-- >1.7.2.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 13189
:
33194
|
33433
|
33451
|
34171
|
34172
|
37741
|
37747