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: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
parent
e37bfe3e4b
commit
e3cc65156e
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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',
|
||||
|
|
|
|||
Loading…
Reference in New Issue