Bugzilla – Attachment 101139 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: (follow-up) Move GetBorrowerAttributes to Koha::Patron - ILSDI
Bug-20443-follow-up-Move-GetBorrowerAttributes-to-.patch (text/plain), 2.59 KB, created by
Jonathan Druart
on 2020-03-20 14:48:00 UTC
(
hide
)
Description:
Bug 20443: (follow-up) Move GetBorrowerAttributes to Koha::Patron - ILSDI
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-03-20 14:48:00 UTC
Size:
2.59 KB
patch
obsolete
>From c9fb5c0f78d0f48feee164e5f267ecb564b638ea Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 9 Aug 2018 19:46:35 -0300 >Subject: [PATCH] Bug 20443: (follow-up) Move GetBorrowerAttributes to > Koha::Patron - ILSDI > >Either we display everything, or only the info from the attribute itself >(i.e. not its type) > >Signed-off-by: Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > C4/ILSDI/Services.pm | 14 ++++++++++++-- > t/db_dependent/ILSDI_Services.t | 10 ++++------ > 2 files changed, 16 insertions(+), 8 deletions(-) > >diff --git a/C4/ILSDI/Services.pm b/C4/ILSDI/Services.pm >index 29cb58a772..e929b37d91 100644 >--- a/C4/ILSDI/Services.pm >+++ b/C4/ILSDI/Services.pm >@@ -506,8 +506,18 @@ sub GetPatronInfo { > if ( $show_attributes && $show_attributes eq "1" ) { > # FIXME Regression expected here, we do not retrieve the same field as previously > # Waiting for answer on bug 14257 comment 15 >- my $attrs = $patron->extended_attributes->search({ opac_display => 1 })->unblessed; >- $borrower->{'attributes'} = $attrs; >+ $borrower->{'attributes'} = [ >+ map { >+ $_->type->opac_display >+ ? { >+ %{ $_->unblessed }, >+ %{ $_->type->unblessed }, >+ value => $_->attribute, # Backward compatibility >+ value_description => $_->description, # Awkward retro-compability... >+ } >+ : () >+ } $patron->extended_attributes->search >+ ]; > } > > # Add is expired information >diff --git a/t/db_dependent/ILSDI_Services.t b/t/db_dependent/ILSDI_Services.t >index 0e1466f648..fdce3f4a0b 100644 >--- a/t/db_dependent/ILSDI_Services.t >+++ b/t/db_dependent/ILSDI_Services.t >@@ -217,13 +217,11 @@ subtest 'GetPatronInfo/GetBorrowerAttributes test for extended patron attributes > > # Build a structure for comparison: > my $cmp = { >- category_code => $attr_type_visible->{'category_code'}, >- class => $attr_type_visible->{'class'}, >- code => $attr_shown->{'code'}, >- description => $attr_type_visible->{'description'}, >- display_checkout => $attr_type_visible->{'display_checkout'}, >+ borrowernumber => $brwr->{borrowernumber}, > value => $attr_shown->{'attribute'}, >- value_description => undef, >+ value_description => $attr_shown->{'attribute'}, >+ %$attr_type_visible, >+ %$attr_shown, > }; > > is( $reply->{'charges'}, '10.00', >-- >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