Bugzilla – Attachment 181363 Details for
Bug 9762
Log circulation overrides
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 9762: (QA follow-up) Remove superflous string construction
Bug-9762-QA-follow-up-Remove-superflous-string-con.patch (text/plain), 9.45 KB, created by
Martin Renvoize (ashimema)
on 2025-04-23 10:15:51 UTC
(
hide
)
Description:
Bug 9762: (QA follow-up) Remove superflous string construction
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2025-04-23 10:15:51 UTC
Size:
9.45 KB
patch
obsolete
>From b9abac91a11e27a7f06f18e540aaba904b1065c2 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@openfifth.co.uk> >Date: Wed, 23 Apr 2025 10:14:43 +0100 >Subject: [PATCH] Bug 9762: (QA follow-up) Remove superflous string > construction > >We never actually pass `$message` back to anywhere so there's no reason >to create it in the first place. >--- > C4/Circulation.pm | 68 ----------------------------------------------- > circ/renew.pl | 3 --- > 2 files changed, 71 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index dd0fb0a4ef7..05db881e54d 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -818,7 +818,6 @@ sub CanBookBeIssued { > my $circ_library = Koha::Libraries->find( _GetCircControlBranch( $item_object, $patron ) ); > > my $now = dt_from_string(); >- my $message; > my @message_log; > > $duedate ||= CalcDateDue( $now, $effective_itemtype, $circ_library->branchcode, $patron ); >@@ -826,14 +825,8 @@ sub CanBookBeIssued { > if ( DateTime->compare( $duedate, $now ) == -1 ) { # duedate cannot be before now > $needsconfirmation{INVALID_DATE} = $duedate; > if ($issueconfirmed) { >- if ($message) { >- $message = "$message + sticky due date is invalid or due date in the past"; >- } else { >- $message = "sticky due date is invalid or due date in the past"; >- } > push( @message_log, "sticky due date is invalid or due date in the past" ); > } >- > } > > my $fees = Koha::Charges::Fees->new( >@@ -880,11 +873,6 @@ sub CanBookBeIssued { > if ( $patron->is_debarred ) { > $issuingimpossible{DEBARRED} = 1; > if ($issueconfirmed) { >- if ($message) { >- $message = "$message + borrower is restricted"; >- } else { >- $message = "borrower is restricted"; >- } > push( @message_log, "borrower is restricted" ); > } > } >@@ -960,11 +948,6 @@ sub CanBookBeIssued { > if ( $patron_borrowing_status->{noissuescharge}->{overlimit} && $allowfineoverride ) { > $needsconfirmation{DEBT} = $patron_borrowing_status->{noissuescharge}->{charge}; > if ($issueconfirmed) { >- if ($message) { >- $message = "$message + borrower had amend"; >- } else { >- $message = "borrower had amend"; >- } > push( @message_log, "borrower had amend" ); > } > } elsif ( $patron_borrowing_status->{noissuescharge}->{overlimit} && !$allowfineoverride ) { >@@ -972,11 +955,6 @@ sub CanBookBeIssued { > } elsif ( $patron_borrowing_status->{noissuescharge}->{charge} > 0 && $allfinesneedoverride ) { > $needsconfirmation{DEBT} = $patron_borrowing_status->{noissuescharge}->{charge}; > if ($issueconfirmed) { >- if ($message) { >- $message = "$message + borrower had amend"; >- } else { >- $message = "borrower had amend"; >- } > push( @message_log, "borrower had amend" ); > } > } >@@ -1060,11 +1038,6 @@ sub CanBookBeIssued { > $needsconfirmation{issued_cardnumber} = $patron->cardnumber; > $needsconfirmation{issued_borrowernumber} = $patron->borrowernumber; > if ($issueconfirmed) { >- if ($message) { >- $message = "$message + item is checked out for someone else "; >- } else { >- $message = "item is checked out for someone else"; >- } > push( @message_log, "item is checked out for someone else" ); > } > } >@@ -1095,11 +1068,6 @@ sub CanBookBeIssued { > $needsconfirmation{max_loans_allowed} = $toomany->{max_allowed}; > $needsconfirmation{circulation_rule_TOO_MANY} = $toomany->{circulation_rule}; > if ($issueconfirmed) { >- if ($message) { >- $message = "$message + too many checkout"; >- } else { >- $message = "too many checkout"; >- } > push( @message_log, "too many checkout" ); > } > } else { >@@ -1130,11 +1098,6 @@ sub CanBookBeIssued { > $needsconfirmation{NOT_FOR_LOAN_FORCING} = 1; > $needsconfirmation{item_notforloan} = $item_object->notforloan; > if ($issueconfirmed) { >- if ($message) { >- $message = "$message + item not for loan"; >- } else { >- $message = "item not for loan"; >- } > push( @message_log, "item not for loan" ); > } > } >@@ -1183,11 +1146,6 @@ sub CanBookBeIssued { > $needsconfirmation{ITEM_LOST} = $code if ( C4::Context->preference("IssueLostItem") eq 'confirm' ); > $alerts{ITEM_LOST} = $code if ( C4::Context->preference("IssueLostItem") eq 'alert' ); > if ($issueconfirmed) { >- if ($message) { >- $message = "$message + item lost"; >- } else { >- $message = "item lost"; >- } > push( @message_log, "item lost" ); > } > } >@@ -1292,12 +1250,6 @@ sub CanBookBeIssued { > $needsconfirmation{'reserve_id'} = $res->{reserve_id}; > > if ($issueconfirmed) { >- if ($message) { >- $message = >- "$message + item is on reserve and waiting, but has been reserved by some other patron."; >- } else { >- $message = "item is on reserve and waiting, but has been reserved by some other patron."; >- } > push( > @message_log, > "item is on reserve and waiting, but has been reserved by some other patron" >@@ -1316,11 +1268,6 @@ sub CanBookBeIssued { > $needsconfirmation{'reserve_id'} = $res->{reserve_id}; > > if ($issueconfirmed) { >- if ($message) { >- $message = "$message + item is on reserve for someone else"; >- } else { >- $message = "item is on reserve for someone else"; >- } > push( @message_log, "item is on reserve for someone else" ); > } > } elsif ( $restype eq "Transferred" ) { >@@ -1336,11 +1283,6 @@ sub CanBookBeIssued { > $needsconfirmation{'reserve_id'} = $res->{reserve_id}; > > if ($issueconfirmed) { >- if ($message) { >- $message = "$message + item is determined hold being transferred for someone else"; >- } else { >- $message = "item is determined hold being transferred for someone else"; >- } > push( @message_log, "item is determined hold being transferred for someone else" ); > } > } elsif ( $restype eq "Processing" ) { >@@ -1356,11 +1298,6 @@ sub CanBookBeIssued { > $needsconfirmation{'reserve_id'} = $res->{reserve_id}; > > if ($issueconfirmed) { >- if ($message) { >- $message = "$message + item is determined hold being processed for someone else"; >- } else { >- $message = "item is determined hold being processed for someone else"; >- } > push( @message_log, "item is determined hold being processed for someone else" ); > } > } >@@ -1407,11 +1344,6 @@ sub CanBookBeIssued { > if ( C4::Context->preference('AgeRestrictionOverride') ) { > $needsconfirmation{AGE_RESTRICTION} = "$agerestriction"; > if ($issueconfirmed) { >- if ($message) { >- $message = "$message + age restriction"; >- } else { >- $message = "age restriction"; >- } > push( @message_log, "age restriction" ); > } > } else { >diff --git a/circ/renew.pl b/circ/renew.pl >index 90833e5b3b9..ff96fc0d6e4 100755 >--- a/circ/renew.pl >+++ b/circ/renew.pl >@@ -68,7 +68,6 @@ if ( $op eq 'cud-renew' && $barcode ) { > my $borrowernumber = $patron->borrowernumber; > my $user = C4::Context->userenv->{number}; > my $branchcode = C4::Context->userenv->{branch}; >- my $message; > my @message; > > if ( ( $patron->is_debarred || q{} ) lt dt_from_string()->ymd() ) { >@@ -81,7 +80,6 @@ if ( $op eq 'cud-renew' && $barcode ) { > $can_renew = 1; > $error = undef; > >- $message = "Override Renew hold for another"; > @message = ("Override Renew hold for another"); > > my $infos = ( >@@ -133,7 +131,6 @@ if ( $op eq 'cud-renew' && $barcode ) { > ); > $template->param( date_due => $date_due ); > >- $message = "Override limit Renew"; > @message = ("Override limit Renew"); > > my $infos = ( >-- >2.49.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 9762
:
149554
|
156222
|
163847
|
164022
|
164067
|
164068
|
164302
|
164387
|
164426
|
164479
|
164508
|
164509
|
164510
|
164519
|
170271
|
170272
|
170273
|
176742
|
177294
|
177295
|
177296
|
178029
|
178030
|
178031
|
178036
|
181303
|
181304
|
181305
|
181306
|
181307
|
181308
|
181340
|
181341
|
181342
|
181343
|
181344
|
181345
|
181346
|
181357
|
181358
|
181359
|
181360
|
181361
|
181362
| 181363 |
181371
|
181381
|
181390
|
181393
|
181545
|
181546