From b1d653d330fb5377be772d482cea0f74a16d8892 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Sat, 24 Oct 2020 02:56:15 +0000 Subject: [PATCH] Bug 23916: (QA follow-up) Remove stray changes and fix typo There were a couple changes that had no effect, so cleaned those up Typo 'is' for 'if' --- C4/Circulation.pm | 2 +- Koha/Patrons.pm | 4 +--- t/db_dependent/Koha/Checkouts.t | 6 +++--- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 97308660ed..09983cdf83 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -1508,7 +1508,7 @@ sub AddIssue { # Get ID of logged in user. if called from a batch job, # no user session exists and C4::Context->userenv() returns - # the scalar '0'. Only do this is the syspref says so + # the scalar '0'. Only do this if the syspref says so if ( C4::Context->preference('RecordStaffUserOnCheckout') ) { my $userenv = C4::Context->userenv(); my $usernumber = (ref($userenv) eq 'HASH') ? $userenv->{'number'} : undef; diff --git a/Koha/Patrons.pm b/Koha/Patrons.pm index a958200d1b..3b3b4b1cb6 100644 --- a/Koha/Patrons.pm +++ b/Koha/Patrons.pm @@ -195,9 +195,7 @@ sub anonymise_issue_history { } ); my $anonymous_patron = C4::Context->preference('AnonymousPatron') || undef; - $nb_rows += $old_issues_to_anonymise->update( { - 'old_issues.borrowernumber' => $anonymous_patron - } ); + $nb_rows += $old_issues_to_anonymise->update( { 'old_issues.borrowernumber' => $anonymous_patron } ); } return $nb_rows; } diff --git a/t/db_dependent/Koha/Checkouts.t b/t/db_dependent/Koha/Checkouts.t index 01c97bb5b6..246a986eea 100755 --- a/t/db_dependent/Koha/Checkouts.t +++ b/t/db_dependent/Koha/Checkouts.t @@ -94,9 +94,6 @@ subtest 'item' => sub { is( $item->itemnumber, $item_1->itemnumber, 'Koha::Checkout->item should return the correct item' ); }; -$retrieved_checkout_1->delete; -is( Koha::Checkouts->search->count, $nb_of_checkouts + 1, 'Delete should have deleted the checkout' ); - subtest 'patron' => sub { plan tests => 3; my $patron = $builder->build_object({class=>'Koha::Patrons', value => {branchcode => $library->{branchcode}}}); @@ -125,6 +122,9 @@ subtest 'patron' => sub { ); }; +$retrieved_checkout_1->delete; +is( Koha::Checkouts->search->count, $nb_of_checkouts + 1, 'Delete should have deleted the checkout' ); + subtest 'issuer' => sub { plan tests => 3; my $patron = $builder->build_object({class=>'Koha::Patrons', value => {branchcode => $library->{branchcode}}}); -- 2.20.1