Bugzilla – Attachment 154368 Details for
Bug 33428
Should only search in searchable patron attributes if searching in standard fields
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33428: Adjust Unit Tests
Bug-33428-Adjust-Unit-Tests.patch (text/plain), 4.51 KB, created by
Nick Clemens (kidclamp)
on 2023-08-11 12:32:02 UTC
(
hide
)
Description:
Bug 33428: Adjust Unit Tests
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2023-08-11 12:32:02 UTC
Size:
4.51 KB
patch
obsolete
>From 794ac52dcabfcd0f46dfaafe73c852c5d402b49b Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Fri, 11 Aug 2023 12:28:15 +0000 >Subject: [PATCH] Bug 33428: Adjust Unit Tests > >--- > koha-tmpl/intranet-tmpl/prog/js/staff-global.js | 8 ++++---- > t/db_dependent/selenium/patrons_search.t | 8 ++++---- > 2 files changed, 8 insertions(+), 8 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js >index 10523a0684..cb03827e4f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js >@@ -523,13 +523,13 @@ function expandPatronSearchFields(search_fields) { > return defaultPatronSearchFields; > break; > case 'full_address': >- return 'streetnumber,streettype,address,address2,city,state,zipcode,country'; >+ return 'streetnumber|streettype|address|address2|city|state|zipcode|country'; > break; > case 'all_emails': >- return 'email,emailpro,B_email'; >+ return 'email|emailpro|B_email'; > break; > case 'all_phones': >- return 'phone,phonepro,B_phone,altcontactphone,mobile'; >+ return 'phone|phonepro|B_phone|altcontactphone|mobile'; > break; > default: > return search_fields; >@@ -595,7 +595,7 @@ function buildPatronSearchQuery(term, options) { > > // Add full search term for each search field > let term_subquery_or = []; >- search_fields.split('|').forEach(function (field, i) { >+ search_fields.split('\|').forEach(function (field, i) { > term_subquery_or.push( > { ["me." + field]: { 'like': leading_wildcard + term + '%' } } > ); >diff --git a/t/db_dependent/selenium/patrons_search.t b/t/db_dependent/selenium/patrons_search.t >index d21d3583a1..2b327a30e3 100755 >--- a/t/db_dependent/selenium/patrons_search.t >+++ b/t/db_dependent/selenium/patrons_search.t >@@ -170,18 +170,18 @@ subtest 'Search patrons' => sub { > $driver->get( $base_url . "/members/members-home.pl" ); > my @adv_options = $driver->find_elements('//select[@id="searchfieldstype"]/option'); > is( scalar @adv_options, $nb_standard_fields + 1, 'All standard fields are searchable if DefaultPatronSearchFields not set. middle_name is there.'); >- is( $adv_options[0]->get_value(), 'firstname|middle_name|surname|othernames|cardnumber|userid', 'Standard search uses hard coded list when DefaultPatronSearchFields not set'); >+ is( $adv_options[0]->get_value(), 'standard', 'Standard search uses value "standard"'); > my @filter_options = $driver->find_elements('//select[@id="searchfieldstype_filter"]/option'); > is( scalar @filter_options, $nb_standard_fields + 1, 'All standard fields + middle_name are searchable by filter if DefaultPatronSearchFields not set'); >- is( $filter_options[0]->get_value(), 'firstname|middle_name|surname|othernames|cardnumber|userid', 'Standard filter uses hard coded list when DefaultPatronSearchFields not set'); >+ is( $filter_options[0]->get_value(), 'standard', 'Standard filter uses hard coded value "standard" DefaultPatronSearchFields not set'); > C4::Context->set_preference('DefaultPatronSearchFields',"firstname|initials"); > $driver->get( $base_url . "/members/members-home.pl" ); > @adv_options = $driver->find_elements('//select[@id="searchfieldstype"]/option'); > is( scalar @adv_options, $nb_standard_fields, 'New option added when DefaultPatronSearchFields is populated with a field. Note that middle_name disappears, we do not want it if not part of DefaultPatronSearchFields'); >- is( $adv_options[0]->get_value(), 'firstname|initials', 'Standard search uses DefaultPatronSearchFields when populated'); >+ is( $adv_options[0]->get_value(), 'standard', 'Standard search uses value "standard"'); > @filter_options = $driver->find_elements('//select[@id="searchfieldstype_filter"]/option'); > is( scalar @filter_options, $nb_standard_fields, 'New filter option added when DefaultPatronSearchFields is populated with a field'); >- is( $filter_options[0]->get_value(), 'firstname|initials', 'Standard filter uses DefaultPatronSearchFields when populated'); >+ is( $filter_options[0]->get_value(), 'standard', 'Standard filter uses value "standard"'); > C4::Context->set_preference('DefaultPatronSearchFields',"firstname|initials|horses"); > $driver->get( $base_url . "/members/members-home.pl" ); > @adv_options = $driver->find_elements('//select[@id="searchfieldstype"]/option'); >-- >2.30.2
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 33428
:
154352
|
154355
|
154367
|
154368
|
154528
|
154529
|
154530
|
154638