Bug 38751: Update Standard ILL backend add_request

Make use of newly updated ILL::Request->extended_attributes method instead of
creating the query manually

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Pedro Amorim 2024-12-19 11:57:07 +00:00 committed by Katrin Fischer
parent 2a6bc075f6
commit 6526e00374
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
1 changed files with 6 additions and 12 deletions

View File

@ -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;
}