@@ -, +, @@ --- Koha/Patron/Modification.pm | 11 ++++++----- Koha/Patron/Modifications.pm | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) --- a/Koha/Patron/Modification.pm +++ a/Koha/Patron/Modification.pm @@ -131,17 +131,18 @@ sub approve { ); } foreach my $attr ( @{$extended_attributes} ) { + $attr->{attribute} = exists $attr->{attribute} ? $attr->{attribute} : $attr->{value}; Koha::Patron::Attribute->new( { borrowernumber => $patron->borrowernumber, code => $attr->{code}, - attribute => $attr->{value} + attribute => $attr->{attribute}, } )->store - if $attr->{value} # there's a value + if $attr->{attribute} # there's a value or - ( defined $attr->{value} # there's a value that is 0, and not - && $attr->{value} ne "" # the empty string which means delete - && $attr->{value} == 0 + ( defined $attr->{attribute} # there's a value that is 0, and not + && $attr->{attribute} ne "" # the empty string which means delete + && $attr->{attribute} == 0 ); } } --- a/Koha/Patron/Modifications.pm +++ a/Koha/Patron/Modifications.pm @@ -131,7 +131,7 @@ sub pending { Koha::Patron::Attribute->new( { borrowernumber => $row->{borrowernumber}, code => $attr->{code}, - attribute => $attr->{value} + attribute => exists $attr->{attribute} ? $attr->{attribute} : $attr->{value}, } ); } --