Bugzilla – Attachment 61291 Details for
Bug 18094
Patron search filters are broken by searchable attributes
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18094: Add tests to highlight the problem
Bug-18094-Add-tests-to-highlight-the-problem.patch (text/plain), 2.80 KB, created by
Nick Clemens (kidclamp)
on 2017-03-20 12:49:19 UTC
(
hide
)
Description:
Bug 18094: Add tests to highlight the problem
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2017-03-20 12:49:19 UTC
Size:
2.80 KB
patch
obsolete
>From dc6a13d4204de84c6f0ed1ff326301b3de71e3a5 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 14 Feb 2017 16:19:25 +0100 >Subject: [PATCH] Bug 18094: Add tests to highlight the problem >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >Signed-off-by: Marc Véron <veron@veron.ch> > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > t/db_dependent/Utils/Datatables_Members.t | 31 ++++++++++++++++++++++++++++++- > 1 file changed, 30 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Utils/Datatables_Members.t b/t/db_dependent/Utils/Datatables_Members.t >index 1d590a5..890c6ae 100644 >--- a/t/db_dependent/Utils/Datatables_Members.t >+++ b/t/db_dependent/Utils/Datatables_Members.t >@@ -17,7 +17,7 @@ > > use Modern::Perl; > >-use Test::More tests => 49; >+use Test::More tests => 50; > > use C4::Context; > use C4::Members; >@@ -280,6 +280,9 @@ C4::Members::Attributes::SetBorrowerAttributes( > C4::Members::Attributes::SetBorrowerAttributes( > $jane_doe->{borrowernumber}, [ { code => $attribute_type->{code}, value => 'the default value for another common user' } ] > ); >+C4::Members::Attributes::SetBorrowerAttributes( >+ $john_smith->{borrowernumber}, [ { code => $attribute_type->{code}, value => 'Attribute which not appears even if contains "Dupont"' } ] >+); > > t::lib::Mocks::mock_preference('ExtendedPatronAttributes', 1); > $search_results = C4::Utils::DataTables::Members::search({ >@@ -429,6 +432,32 @@ $search_results = C4::Utils::DataTables::Members::search({ > is( $search_results->{ iTotalDisplayRecords }, 2, > "Sarching by date of birth should handle date formatted in iso"); > >+subtest 'ExtendedPatronAttributes' => sub { >+ plan tests => 2; >+ t::lib::Mocks::mock_preference('ExtendedPatronAttributes', 1); >+ $search_results = C4::Utils::DataTables::Members::search({ >+ searchmember => "Dupont", >+ searchfieldstype => 'standard', >+ searchtype => 'contain', >+ branchcode => $branchcode, >+ dt_params => \%dt_params >+ }); >+ >+ is( $search_results->{ iTotalDisplayRecords }, 3, >+ "'Dupont' is contained in 2 surnames and a patron attribute. Patron attribute one should be displayed if searching in all fields (Bug 18094)"); >+ >+ $search_results = C4::Utils::DataTables::Members::search({ >+ searchmember => "Dupont", >+ searchfieldstype => 'surname', >+ searchtype => 'contain', >+ branchcode => $branchcode, >+ dt_params => \%dt_params >+ }); >+ >+ is( $search_results->{ iTotalDisplayRecords }, 1, >+ "'Dupont' is contained in 2 surnames and a patron attribute. Patron attribute one should not be displayed if searching in specific fields (Bug 18094)"); >+}; >+ > # End > $schema->storage->txn_rollback; > >-- >2.1.4
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 18094
:
60212
|
60213
|
61111
|
61112
| 61291 |
61292
|
63015
|
63016