From 27a2c98e537ee2e56b9ff877725b9ff823009429 Mon Sep 17 00:00:00 2001 From: Arthur Suzuki Date: Tue, 25 Jun 2019 11:17:24 +0200 Subject: [PATCH] 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 Signed-off-by: Marcel de Rooy Signed-off-by: Martin Renvoize (cherry picked from commit fa390ca232a0979c6786a0e00eca8d458f644f3e) Signed-off-by: Fridolin Somers (cherry picked from commit ecff60025871d739f695a2ae5b88613ce6617854) Signed-off-by: Lucas Gass --- Koha/Patron.pm | 4 ++++ members/memberentry.pl | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Koha/Patron.pm b/Koha/Patron.pm index f812382be7..483c2afc43 100644 --- a/Koha/Patron.pm +++ b/Koha/Patron.pm @@ -192,6 +192,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 diff --git a/members/memberentry.pl b/members/memberentry.pl index 93c92c8f37..06377354e3 100755 --- a/members/memberentry.pl +++ b/members/memberentry.pl @@ -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}; -- 2.39.5