From 5a7bf6bbec22d54d6306fb1aac1f9c27a21c0694 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Fri, 27 Sep 2019 07:23:28 -0400 Subject: [PATCH] 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 Signed-off-by: Nick Clemens Signed-off-by: Martin Renvoize (cherry picked from commit 62ad053894c57ae990a9724cf58beaa4441448c6) Signed-off-by: Fridolin Somers (cherry picked from commit 0c9c78341b5f0c855fcf2a697edc31eb6e1262fc) Signed-off-by: Lucas Gass --- Koha/Patron.pm | 2 +- t/db_dependent/Koha/Patrons.t | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Koha/Patron.pm b/Koha/Patron.pm index db0362bafc..69cc297652 100644 --- a/Koha/Patron.pm +++ b/Koha/Patron.pm @@ -194,7 +194,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 diff --git a/t/db_dependent/Koha/Patrons.t b/t/db_dependent/Koha/Patrons.t index c69625ddd5..4b317a15d5 100644 --- a/t/db_dependent/Koha/Patrons.t +++ b/t/db_dependent/Koha/Patrons.t @@ -1512,13 +1512,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.'); -- 2.39.5