From 2dc38c9827f1a289f5e501f979074b6dc07487a4 Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Thu, 19 Dec 2024 11:57:07 +0000 Subject: [PATCH] Bug 38751: Update Standard ILL backend add_request Make use of newly updated ILL::Request->extended_attributes method instead of creating the query manually --- Koha/ILL/Backend/Standard.pm | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/Koha/ILL/Backend/Standard.pm b/Koha/ILL/Backend/Standard.pm index 41fc046bfff..d3ed496f7f4 100644 --- a/Koha/ILL/Backend/Standard.pm +++ b/Koha/ILL/Backend/Standard.pm @@ -991,19 +991,13 @@ sub add_request { if column_exists( 'illrequests', 'batch_id' ); $request->store; - while ( my ( $type, $value ) = each %{$request_details} ) { - if ( $value && length $value > 0 ) { - Koha::ILL::Request::Attribute->new( - { - illrequest_id => $request->illrequest_id, - column_exists( 'illrequestattributes', 'backend' ) ? ( backend => "Standard" ) : (), - type => $type, - value => $value, - readonly => 0 - } - )->store; + my @request_details_array = map { + { + 'type' => $_, + 'value' => $request_details->{$_}, } - } + } keys %{$request_details}; + $request->extended_attributes( \@request_details_array ); return $request; } -- 2.39.5