Bugzilla – Attachment 182820 Details for
Bug 39970
REST API - Creating a patron without mandatory attribute types does not error (it should)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39970: Remove changed_attributes_codes check
Bug-39970-Remove-changedattributescodes-check.patch (text/plain), 4.35 KB, created by
Nick Clemens (kidclamp)
on 2025-05-28 12:14:09 UTC
(
hide
)
Description:
Bug 39970: Remove changed_attributes_codes check
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2025-05-28 12:14:09 UTC
Size:
4.35 KB
patch
obsolete
>From 13df8063273db51a757c7229807dd0df8510a084 Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@openfifth.co.uk> >Date: Thu, 22 May 2025 13:44:14 +0000 >Subject: [PATCH] Bug 39970: Remove changed_attributes_codes check > >Signed-off-by: David Nind <david@davidnind.com> >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > Koha/Patron.pm | 69 ++++++++++++++++++++++++-------------------------- > 1 file changed, 33 insertions(+), 36 deletions(-) > >diff --git a/Koha/Patron.pm b/Koha/Patron.pm >index d9f08197d4b..75b8ec23f23 100644 >--- a/Koha/Patron.pm >+++ b/Koha/Patron.pm >@@ -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 } ) >+ ); > } > } > ); >-- >2.39.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 39970
:
182731
|
182732
|
182736
|
182737
|
182803
|
182819
| 182820