Bug 23199: Koha::Patron->store must check 'uppercasesurname' syspref

Test plan:
1/ set uppercasesurname to 'Do'
2/ register a new patron using the REST API with lowercase surname
3/ verify the surname is not saved in uppercase
4/ apply patch
5/ repeat 2
6/ verify the surname now is saved to uppercase

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Arthur Suzuki 2019-06-25 11:17:24 +02:00 committed by Martin Renvoize
parent 9796f5adb3
commit fa390ca232
Signed by: martin.renvoize
GPG key ID: 422B469130441A0F
2 changed files with 4 additions and 4 deletions

View file

@ -193,6 +193,10 @@ sub store {
$self->trim_whitespaces;
# Set surname to uppercase if uppercasesurname is true
$self->surname( uc($self->surname) )
if C4::Context->preference("uppercasesurname");
unless ( $self->in_storage ) { #AddMember
# Generate a valid userid/login if needed

View file

@ -343,10 +343,6 @@ if ($op eq 'save' || $op eq 'insert'){
}
}
if($newdata{surname} && C4::Context->preference('uppercasesurnames')) {
$newdata{'surname'} = uc($newdata{'surname'});
}
if (C4::Context->preference("IndependentBranches")) {
unless ( C4::Context->IsSuperLibrarian() ){
$debug and print STDERR " $newdata{'branchcode'} : ".$userenv->{flags}.":".$userenv->{branch};