Bug 23688: System preference uppercasesurnames broken by typo

In the process of moving this feature from memberentry.pl to Patron.pm, the 's' on uppercasesurnames was dropped, breaking the feature.

Test Plan:
1) Test uppercasesurnames, note it does not work
2) Apply this patch
3) Test uppercasesurnames, note it works now!

Signed-off-by: Kyle Hall <kyle@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 62ad053894)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
Kyle M Hall 2019-09-27 07:23:28 -04:00 committed by Fridolin Somers
parent 19b44c8b44
commit 0c9c78341b
2 changed files with 4 additions and 4 deletions

View File

@ -195,7 +195,7 @@ sub store {
# Set surname to uppercase if uppercasesurname is true
$self->surname( uc($self->surname) )
if C4::Context->preference("uppercasesurname");
if C4::Context->preference("uppercasesurnames");
unless ( $self->in_storage ) { #AddMember

View File

@ -1567,13 +1567,13 @@ subtest '->store' => sub {
$patron_1->surname('xxx')->store;
is( $patron_1->password, $digest, 'Password should not have changed on ->store');
# Test uppercasesurname
t::lib::Mocks::mock_preference( 'uppercasesurname', 1 );
# Test uppercasesurnames
t::lib::Mocks::mock_preference( 'uppercasesurnames', 1 );
my $surname = lc $patron_1->surname;
$patron_1->surname($surname)->store;
isnt( $patron_1->surname, $surname,
'Surname converts to uppercase on store.');
t::lib::Mocks::mock_preference( 'uppercasesurname', 0 );
t::lib::Mocks::mock_preference( 'uppercasesurnames', 0 );
$patron_1->surname($surname)->store;
is( $patron_1->surname, $surname,
'Surname remains unchanged on store.');