Bug 39970: Remove changed_attributes_codes check

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit c81784956b)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
This commit is contained in:
Pedro Amorim 2025-05-22 13:44:14 +00:00 committed by Paul Derscheid
parent 0a05114dc4
commit 975ccc604b
No known key found for this signature in database
GPG Key ID: C25F9FD44CED595B
1 changed files with 33 additions and 36 deletions

View File

@ -2387,47 +2387,44 @@ sub extended_attributes {
}
}
if (%changed_attributes_codes) {
# Store changed attributes in the order they where passed in as some tests
# relies on ids being assigned in that order
my $new_types = {};
for my $new_attribute (@new_attributes) {
$new_attribute->store() if $changed_attributes_codes{ $new_attribute->code };
$new_types->{ $new_attribute->code } = 1;
}
# Store changed attributes in the order they where passed in as some tests
# relies on ids being assigned in that order
my $new_types = {};
for my $new_attribute (@new_attributes) {
$new_attribute->store() if $changed_attributes_codes{ $new_attribute->code };
$new_types->{ $new_attribute->code } = 1;
}
# Check globally mandatory types
my $interface = C4::Context->interface;
my $params = {
mandatory => 1,
category_code => [ undef, $self->categorycode ],
'borrower_attribute_types_branches.b_branchcode' => undef,
};
# Check globally mandatory types
my $interface = C4::Context->interface;
my $params = {
mandatory => 1,
category_code => [ undef, $self->categorycode ],
'borrower_attribute_types_branches.b_branchcode' => undef,
};
if ( $interface eq 'opac' ) {
$params->{opac_editable} = 1;
}
if ( $interface eq 'opac' ) {
$params->{opac_editable} = 1;
}
my @required_attribute_types = Koha::Patron::Attribute::Types->search(
$params,
{ join => 'borrower_attribute_types_branches' }
)->get_column('code');
my @required_attribute_types = Koha::Patron::Attribute::Types->search(
$params,
{ join => 'borrower_attribute_types_branches' }
)->get_column('code');
for my $type (@required_attribute_types) {
Koha::Exceptions::Patron::MissingMandatoryExtendedAttribute->throw(
type => $type,
) if !$new_types->{$type};
}
for my $type (@required_attribute_types) {
Koha::Exceptions::Patron::MissingMandatoryExtendedAttribute->throw(
type => $type,
) if !$new_types->{$type};
}
if ( %{$all_changes} ) {
logaction(
"MEMBERS",
"MODIFY",
$self->borrowernumber,
to_json( $all_changes, { pretty => 1, canonical => 1 } )
);
}
if ( %{$all_changes} ) {
logaction(
"MEMBERS",
"MODIFY",
$self->borrowernumber,
to_json( $all_changes, { pretty => 1, canonical => 1 } )
);
}
}
);