@@ -, +, @@ --- Koha/Patron/Modification.pm | 14 +++++++++----- Koha/Patron/Modifications.pm | 6 +++++- 2 files changed, 14 insertions(+), 6 deletions(-) --- a/Koha/Patron/Modification.pm +++ a/Koha/Patron/Modification.pm @@ -92,14 +92,18 @@ sub approve { delete $data->{verification_token}; delete $data->{extended_attributes}; - foreach my $key ( keys %$data ) { - delete $data->{$key} unless ( defined( $data->{$key} ) ); - } - my $patron = Koha::Patrons->find( $self->borrowernumber ); - return unless $patron; + foreach my $key ( keys %$data ) { + next # Unset it! + if $key eq 'dateofbirth' + && $patron->dateofbirth + && not defined $data->{$key}; + + delete $data->{$key} unless defined $data->{$key}; + } + $patron->set($data); # Take care of extended attributes --- a/Koha/Patron/Modifications.pm +++ a/Koha/Patron/Modifications.pm @@ -132,7 +132,11 @@ sub pending { $row->{$key} = \@pending_attributes; } - delete $row->{$key} unless defined $row->{$key}; + if ( $key eq 'dateofbirth' and not defined $row->{$key}) { + $row->{$key} = ''; + } else { + delete $row->{$key} unless defined $row->{$key}; + } } push( @m, $row ); --