@@ -, +, @@ Koha::Patron - ILSDI --- C4/ILSDI/Services.pm | 14 ++++++++++++-- t/db_dependent/ILSDI_Services.t | 10 ++++------ 2 files changed, 16 insertions(+), 8 deletions(-) --- a/C4/ILSDI/Services.pm +++ a/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 --- a/t/db_dependent/ILSDI_Services.t +++ a/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', --