diff --git a/Koha/REST/V1/Patrons.pm b/Koha/REST/V1/Patrons.pm index 7d733c10dc..c6043419e2 100644 --- a/Koha/REST/V1/Patrons.pm +++ b/Koha/REST/V1/Patrons.pm @@ -110,6 +110,9 @@ sub add { my $patron = Koha::Patron->new_from_api($body)->store; + $patron->extended_attributes( + [ map { { code => $_->{type}, attribute => $_->{value} } } @$extended_attributes ] ); + my $overrides = $c->stash('koha.overrides'); if ( $overrides->{welcome_yes} || ( C4::Context->preference("AutoEmailNewUser") && !$overrides->{welcome_no} ) ) @@ -145,8 +148,6 @@ sub add { } } - $patron->extended_attributes( - [ map { { code => $_->{type}, attribute => $_->{value} } } @$extended_attributes ] ); if ( C4::Context->preference('EnhancedMessagingPreferences') ) { C4::Members::Messaging::SetMessagingPreferencesFromDefaults( {