Bugzilla – Attachment 162965 Details for
Bug 35840
Local use is double-counted when using both RecordLocalUseOnReturn and statistical patrons
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35840: (QA follow-up) Tidy and critic fix
Bug-35840-QA-follow-up-Tidy-and-critic-fix.patch (text/plain), 4.65 KB, created by
Martin Renvoize (ashimema)
on 2024-03-08 14:42:51 UTC
(
hide
)
Description:
Bug 35840: (QA follow-up) Tidy and critic fix
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-03-08 14:42:51 UTC
Size:
4.65 KB
patch
obsolete
>From 9ea675f16517709241db40b809527dbfcf8cd0df Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Fri, 8 Mar 2024 14:40:01 +0000 >Subject: [PATCH] Bug 35840: (QA follow-up) Tidy and critic fix > >--- > C4/Circulation.pm | 11 +++++++---- > t/db_dependent/Circulation.t | 22 +++++++++++++++++----- > 2 files changed, 24 insertions(+), 9 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index c1acb350cee..1de9b54873e 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -819,8 +819,9 @@ sub CanBookBeIssued { > # > # BORROWER STATUS > # >- if ( $patron->category->category_type eq 'X' && ( $item_object->barcode )) { >- # stats only borrower -- add entry to statistics table, and return issuingimpossible{STATS} = 1 . >+ if ( $patron->category->category_type eq 'X' && ( $item_object->barcode ) ) { >+ >+ # stats only borrower -- add entry to statistics table, and return issuingimpossible{STATS} = 1 . > C4::Stats::UpdateStats( > { > branch => C4::Context->userenv->{'branch'}, >@@ -835,8 +836,10 @@ sub CanBookBeIssued { > } > ); > my $block_lost_return = C4::Context->preference("BlockReturnOfLostItems") ? 1 : 0; >- my ( $stats_return, $stats_messages, $stats_iteminformation, $stats_borrower ) = >- AddReturn( $item_object->barcode, C4::Context->userenv->{'branch'}, undef, undef, 1 ) if $item_object->onloan; >+ my ( $stats_return, $stats_messages, $stats_iteminformation, $stats_borrower ); >+ ( $stats_return, $stats_messages, $stats_iteminformation, $stats_borrower ) = >+ AddReturn( $item_object->barcode, C4::Context->userenv->{'branch'}, undef, undef, 1 ) >+ if $item_object->onloan; > ModDateLastSeen( $item_object->itemnumber, $block_lost_return ); # FIXME Move to Koha::Item > return ( > { >diff --git a/t/db_dependent/Circulation.t b/t/db_dependent/Circulation.t >index a12fa4babf6..42418c72ac4 100755 >--- a/t/db_dependent/Circulation.t >+++ b/t/db_dependent/Circulation.t >@@ -2479,7 +2479,7 @@ subtest 'CanBookBeIssued + Koha::Patron->is_debarred|has_overdues' => sub { > subtest 'CanBookBeIssued + Statistic patrons "X"' => sub { > plan tests => 14; > >- my $library = $builder->build_object( { class => 'Koha::Libraries' } ); >+ my $library = $builder->build_object( { class => 'Koha::Libraries' } ); > my $patron_category_x = $builder->build_object( > { > class => 'Koha::Patron::Categories', >@@ -2505,7 +2505,10 @@ subtest 'CanBookBeIssued + Statistic patrons "X"' => sub { > ); > > my ( $error, $question, $alerts ) = CanBookBeIssued( $patron, $item_1->barcode ); >- is( $error->{STATS}, 1, '"Error" flag "STATS" must be set if CanBookBeIssued is called with a statistic patron (category_type=X)' ); >+ is( >+ $error->{STATS}, 1, >+ '"Error" flag "STATS" must be set if CanBookBeIssued is called with a statistic patron (category_type=X)' >+ ); > > my $stat = Koha::Statistics->search( { itemnumber => $item_1->itemnumber } )->next; > is( $stat->branch, C4::Context->userenv->{'branch'}, 'Recorded a branch' ); >@@ -2532,15 +2535,24 @@ subtest 'CanBookBeIssued + Statistic patrons "X"' => sub { > my $item_3 = $builder->build_sample_item( { library => $library->branchcode } ); > CanBookBeIssued( $patron, $item_3->barcode ); > $item_3->discard_changes; >- is( Koha::Statistics->search( { itemnumber => $item_3->itemnumber } )->count, 1, 'Single entry recorded in the stats table' ); >+ is( >+ Koha::Statistics->search( { itemnumber => $item_3->itemnumber } )->count, 1, >+ 'Single entry recorded in the stats table' >+ ); > > my $item_4 = $builder->build_sample_item( { library => $library->branchcode } ); > AddIssue( $patron_2, $item_4->barcode ); > $item_4->discard_changes; >- is( Koha::Statistics->search( { itemnumber => $item_4->itemnumber } )->count, 1, 'Issue should be recorded in statistics table for item 4.' ); >+ is( >+ Koha::Statistics->search( { itemnumber => $item_4->itemnumber } )->count, 1, >+ 'Issue should be recorded in statistics table for item 4.' >+ ); > CanBookBeIssued( $patron, $item_4->barcode ); > $item_4->discard_changes; >- is( Koha::Statistics->search( { itemnumber => $item_4->itemnumber } )->count, 3, 'Issue, return, and localuse should be recorded in statistics table for item 4.' ); >+ is( >+ Koha::Statistics->search( { itemnumber => $item_4->itemnumber } )->count, 3, >+ 'Issue, return, and localuse should be recorded in statistics table for item 4.' >+ ); > > # TODO There are other tests to provide here > }; >-- >2.44.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 35840
:
161212
|
161217
|
161223
|
161374
|
161442
|
161443
|
161612
|
161613
|
161614
|
161732
|
161733
|
162963
|
162964
| 162965