Bugzilla – Attachment 161990 Details for
Bug 16117
Log invalid patron cardnumbers and item barcodes
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16117: (QA follow-up): tidy up code & fix test name
Bug-16117-QA-follow-up-tidy-up-code--fix-test-name.patch (text/plain), 4.58 KB, created by
Victor Grousset/tuxayo
on 2024-02-09 18:01:51 UTC
(
hide
)
Description:
Bug 16117: (QA follow-up): tidy up code & fix test name
Filename:
MIME Type:
Creator:
Victor Grousset/tuxayo
Created:
2024-02-09 18:01:51 UTC
Size:
4.58 KB
patch
obsolete
>From cf83134e82070e262aaacc338410b0ff18e4abce Mon Sep 17 00:00:00 2001 >From: Victor Grousset/tuxayo <victor@tuxayo.net> >Date: Fri, 9 Feb 2024 18:43:10 +0100 >Subject: [PATCH] Bug 16117: (QA follow-up): tidy up code & fix test name > >--- > Koha/Statistic.pm | 5 +++-- > Koha/Statistics.pm | 4 ++-- > installer/data/mysql/atomicupdate/bug_16117.pl | 13 ++++++++----- > t/db_dependent/Koha/Statistics.t | 4 ++-- > 4 files changed, 15 insertions(+), 11 deletions(-) > >diff --git a/Koha/Statistic.pm b/Koha/Statistic.pm >index aeaace4796..e1e3dc4e37 100644 >--- a/Koha/Statistic.pm >+++ b/Koha/Statistic.pm >@@ -27,8 +27,9 @@ use Koha::BackgroundJob::PseudonymizeStatistic; > > use base qw(Koha::Object); > >-our @allowed_accounts_types = qw( writeoff payment ); >-our @allowed_circulation_types = qw( renew issue localuse return onsite_checkout recall item_found item_lost invalid_item invalid_patron); >+our @allowed_accounts_types = qw( writeoff payment ); >+our @allowed_circulation_types = >+ qw( renew issue localuse return onsite_checkout recall item_found item_lost invalid_item invalid_patron); > our @mandatory_accounts_keys = qw( type branch borrowernumber value ); # note that amount is mapped to value > our @mandatory_circulation_keys = qw( type branch borrowernumber itemnumber ccode itemtype ); > >diff --git a/Koha/Statistics.pm b/Koha/Statistics.pm >index 219da6867e..af43ba1817 100644 >--- a/Koha/Statistics.pm >+++ b/Koha/Statistics.pm >@@ -87,8 +87,8 @@ sub _log_invalid_value { > my $type = $params->{type}; > my $value = $params->{value}; > >- my $branch = C4::Context->userenv ? C4::Context->userenv->{branch} : undef; >- my $dt = dt_from_string(); >+ my $branch = C4::Context->userenv ? C4::Context->userenv->{branch} : undef; >+ my $dt = dt_from_string(); > my $borrowernumber = C4::Context->userenv->{'number'}; > > return Koha::Statistic->new( >diff --git a/installer/data/mysql/atomicupdate/bug_16117.pl b/installer/data/mysql/atomicupdate/bug_16117.pl >index 21510aeaa8..2d98bb5717 100755 >--- a/installer/data/mysql/atomicupdate/bug_16117.pl >+++ b/installer/data/mysql/atomicupdate/bug_16117.pl >@@ -1,17 +1,20 @@ > use Modern::Perl; > > return { >- bug_number => "16117", >+ bug_number => "16117", > description => "Log invalid borrower cardnumbers and item barcodes", >- up => sub { >+ up => sub { > my ($args) = @_; >- my ($dbh, $out) = @$args{qw(dbh out)}; >+ my ( $dbh, $out ) = @$args{qw(dbh out)}; > >- $dbh->do(q{ >+ $dbh->do( >+ q{ > INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES > ('LogInvalidItems','0','','Log scanned invalid item identifiers as statistics','YesNo'), > ('LogInvalidPatrons','0','','Log scanned invalid patron identifiers as statistics','YesNo'); >- }); >+ } >+ ); >+ > # sysprefs > say $out "Added new system preference 'LogInvalidItems'"; > say $out "Added new system preference 'LogInvalidPatrons'"; >diff --git a/t/db_dependent/Koha/Statistics.t b/t/db_dependent/Koha/Statistics.t >index 6cfc2c6174..b140278a07 100755 >--- a/t/db_dependent/Koha/Statistics.t >+++ b/t/db_dependent/Koha/Statistics.t >@@ -196,7 +196,7 @@ subtest 'Log borrower cardnumbers and item barcodes which are not valid' => sub > Koha::Statistics->log_invalid_patron( { patron => 'InvalidCardnumber' } ); > my $stat = Koha::Statistics->search()->next(); > is( $stat->type, 'invalid_patron', 'Type set to invalid_patron' ); >- is( $stat->borrowernumber, '-1', 'Associated library id set correctly' ); >+ is( $stat->borrowernumber, '-1', 'Associated patron id set correctly' ); > is( $stat->other, 'InvalidCardnumber', 'Invalid cardnumber is set correctly' ); > is( $stat->branch, $branchcode, 'Branchcode is set correctly' ); > >@@ -210,7 +210,7 @@ subtest 'Log borrower cardnumbers and item barcodes which are not valid' => sub > Koha::Statistics->log_invalid_item( { item => 'InvalidBarcode' } ); > $stat = Koha::Statistics->search()->next(); > is( $stat->type, 'invalid_item', 'Type set to invalid_item' ); >- is( $stat->borrowernumber, '-1', 'Associated library id set correctly' ); >+ is( $stat->borrowernumber, '-1', 'Associated patron id set correctly' ); > is( $stat->other, 'InvalidBarcode', 'Invalid barcode is set correctly' ); > is( $stat->branch, $branchcode, 'Branchcode is set correctly' ); > >-- >2.43.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 16117
:
65317
|
65319
|
73177
|
73178
|
81273
|
81274
|
153493
|
155498
|
158531
|
158532
| 161990