From de2708e788108711a1d7859523edc15d3c64bd01 Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Fri, 16 May 2025 16:07:12 +0000 Subject: [PATCH] Bug 39934: Only fetch attributes from 'Standard' Furthermore, this now only shows metadata present in _get_core_fields, so a list of attributes to ignore is not longer needed (they're not in _get_core_fields). --- Koha/ILL/Backend/Standard.pm | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/Koha/ILL/Backend/Standard.pm b/Koha/ILL/Backend/Standard.pm index 5962cd17653..2102cb73765 100644 --- a/Koha/ILL/Backend/Standard.pm +++ b/Koha/ILL/Backend/Standard.pm @@ -145,19 +145,13 @@ that we do not consider to be metadata sub metadata { my ( $self, $request ) = @_; - my $attrs = $request->extended_attributes; - my $metadata = {}; - my @ignore = ( - 'requested_partners', 'type', 'type_disclaimer_value', 'type_disclaimer_date', 'unauthenticated_first_name', - 'unauthenticated_last_name', 'unauthenticated_email', 'historycheck_requests' - ); + my $attrs = $request->extended_attributes->search( { backend => 'Standard' } ); + my $metadata = {}; my $core_fields = _get_core_fields(); while ( my $attr = $attrs->next ) { my $type = $attr->type; - if ( !grep { $_ eq $type } @ignore ) { - my $name; - $name = $core_fields->{$type} || ucfirst($type); - $metadata->{$name} = $attr->value; + if ( $core_fields->{$type} ) { + $metadata->{ $core_fields->{$type} } = $attr->value; } } return $metadata; -- 2.39.5