Bugzilla – Attachment 101223 Details for
Bug 20443
Move C4::Members::Attributes to Koha namespace
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20443: Remove SearchIdMatchingAttribute
Bug-20443-Remove-SearchIdMatchingAttribute.patch (text/plain), 3.91 KB, created by
Jonathan Druart
on 2020-03-20 15:05:51 UTC
(
hide
)
Description:
Bug 20443: Remove SearchIdMatchingAttribute
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-03-20 15:05:51 UTC
Size:
3.91 KB
patch
obsolete
>From 6df26fca289ba9db2c19c6354bb4d71c9e9a76a4 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 16 Jul 2018 14:23:27 -0300 >Subject: [PATCH] Bug 20443: Remove SearchIdMatchingAttribute > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > C4/Members.pm | 1 - > C4/Members/Attributes.pm | 15 +-------------- > C4/Utils/DataTables/Members.pm | 5 ++--- > t/db_dependent/Members/Attributes.t | 8 -------- > 4 files changed, 3 insertions(+), 26 deletions(-) > >diff --git a/C4/Members.pm b/C4/Members.pm >index 9355436c33..6c10eeeb2c 100644 >--- a/C4/Members.pm >+++ b/C4/Members.pm >@@ -33,7 +33,6 @@ use C4::Reserves; > use C4::Accounts; > use C4::Biblio; > use C4::Letters; >-use C4::Members::Attributes qw(SearchIdMatchingAttribute); > use C4::NewsChannels; #get slip news > use DateTime; > use Koha::Database; >diff --git a/C4/Members/Attributes.pm b/C4/Members/Attributes.pm >index 19b5b9e6ef..76cd6a9b32 100644 >--- a/C4/Members/Attributes.pm >+++ b/C4/Members/Attributes.pm >@@ -32,7 +32,7 @@ BEGIN { > @ISA = qw(Exporter); > @EXPORT_OK = qw( > extended_attributes_code_value_arrayref extended_attributes_merge >- SearchIdMatchingAttribute); >+ ); > %EXPORT_TAGS = ( all => \@EXPORT_OK ); > } > >@@ -46,19 +46,6 @@ C4::Members::Attributes - manage extend patron attributes > > =head1 FUNCTIONS > >-=head2 SearchIdMatchingAttribute >- >- my $matching_borrowernumbers = C4::Members::Attributes::SearchIdMatchingAttribute($filter); >- >-=cut >-use Koha::Patrons; >-sub SearchIdMatchingAttribute{ >- my $filter = shift; >- >- my @borrowernumbers = Koha::Patrons->filter_by_attribute_value($filter)->get_column('borrowernumber'); >- return \@borrowernumbers; >-} >- > =head2 extended_attributes_code_value_arrayref > > my $patron_attributes = "homeroom:1150605,grade:01,extradata:foobar"; >diff --git a/C4/Utils/DataTables/Members.pm b/C4/Utils/DataTables/Members.pm >index c4726ec89f..b7887a858e 100644 >--- a/C4/Utils/DataTables/Members.pm >+++ b/C4/Utils/DataTables/Members.pm >@@ -4,7 +4,6 @@ use Modern::Perl; > use C4::Context; > use C4::Utils::DataTables; > use Koha::DateUtils; >-use C4::Members::Attributes qw(SearchIdMatchingAttribute ); > > sub search { > my ( $params ) = @_; >@@ -131,9 +130,9 @@ sub search { > > > if ( $searchfieldstype eq 'standard' and C4::Context->preference('ExtendedPatronAttributes') and $searchmember ) { >- my $matching_borrowernumbers = C4::Members::Attributes::SearchIdMatchingAttribute($searchmember); >+ my @matching_borrowernumbers = Koha::Patrons->filter_by_attribute_value($searchmember)->get_column('borrowernumber'); > >- for my $borrowernumber ( @$matching_borrowernumbers ) { >+ for my $borrowernumber ( @matching_borrowernumbers ) { > push @where_strs_or, "borrowers.borrowernumber = ?"; > push @where_args, $borrowernumber; > } >diff --git a/t/db_dependent/Members/Attributes.t b/t/db_dependent/Members/Attributes.t >index 32e9c7e365..33aa063d95 100644 >--- a/t/db_dependent/Members/Attributes.t >+++ b/t/db_dependent/Members/Attributes.t >@@ -182,14 +182,6 @@ throws_ok { # Creating a new one, but already exists! > } 'Koha::Exceptions::Patron::Attribute::UniqueIDConstraint'; > > >-my $borrower_numbers = C4::Members::Attributes::SearchIdMatchingAttribute('attribute1'); >-is( @$borrower_numbers, 0, 'SearchIdMatchingAttribute searchs only in attributes with staff_searchable=1' ); >-for my $attr( split(' ', $attributes->[1]->{attribute}) ) { >- $borrower_numbers = C4::Members::Attributes::SearchIdMatchingAttribute($attr); >- is( $borrower_numbers->[0], $borrowernumber, 'SearchIdMatchingAttribute returns the borrower numbers matching' ); >-} >- >- > $patron->get_extended_attribute($attribute->{code})->delete; > $borrower_attributes = $patron->extended_attributes; > is( $borrower_attributes->count, 2, 'delete attribute by code' ); >-- >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 20443
:
101122
|
101123
|
101124
|
101125
|
101126
|
101127
|
101128
|
101129
|
101130
|
101131
|
101132
|
101133
|
101134
|
101135
|
101136
|
101137
|
101138
|
101139
|
101140
|
101141
|
101142
|
101143
|
101144
|
101145
|
101146
|
101147
|
101148
|
101149
|
101150
|
101209
|
101210
|
101211
|
101212
|
101213
|
101214
|
101215
|
101216
|
101217
|
101218
|
101219
|
101220
|
101221
|
101222
| 101223 |
101224
|
101225
|
101226
|
101227
|
101228
|
101229
|
101230
|
101231
|
101232
|
101233
|
101234
|
101235
|
101236
|
101237
|
101472
|
104519