From 3bcd3398d14126a044399945ca959520632906a3 Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Mon, 19 May 2025 10:17:10 +0000 Subject: [PATCH] Bug 39934: Use _get_core_fields as fields to be migrated Also add backend check to add_or_update_attributes --- Koha/ILL/Backend/Standard.pm | 3 ++- Koha/ILL/Request.pm | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Koha/ILL/Backend/Standard.pm b/Koha/ILL/Backend/Standard.pm index f29b72046ab..ab0b8a76591 100644 --- a/Koha/ILL/Backend/Standard.pm +++ b/Koha/ILL/Backend/Standard.pm @@ -677,7 +677,8 @@ sub migrate { $new_request->updated( dt_from_string() ); $new_request->store; - my @default_attributes = (qw/title type author year volume isbn issn article_title article_author pages/); + my %core_fields = %{ _get_core_fields() }; + my @default_attributes = keys %core_fields; my $original_attributes = $original_request->extended_attributes->search( { type => { '-in' => \@default_attributes } } ); diff --git a/Koha/ILL/Request.pm b/Koha/ILL/Request.pm index 5e76fc5889e..2d019803f87 100644 --- a/Koha/ILL/Request.pm +++ b/Koha/ILL/Request.pm @@ -1350,8 +1350,7 @@ sub add_or_update_attributes { # Skip undefined or empty values next unless defined $value && $value ne ''; - my $attr = $self->extended_attributes->find( { type => $type } ); - + my $attr = $self->extended_attributes->find( { backend => $self->backend, type => $type } ); if ($attr) { # Update existing attribute only if value changed -- 2.39.5