Bugzilla – Attachment 149144 Details for
Bug 33210
(Bug 31963 follow-up) No hold fee message on OPAC should be displayed when there is no fee
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33210: (Bug 31963 follow-up) No hold fee message on OPAC should be displayed when there is no fee
Bug-33210-Bug-31963-follow-up-No-hold-fee-message-.patch (text/plain), 1.93 KB, created by
David Nind
on 2023-04-04 21:56:44 UTC
(
hide
)
Description:
Bug 33210: (Bug 31963 follow-up) No hold fee message on OPAC should be displayed when there is no fee
Filename:
MIME Type:
Creator:
David Nind
Created:
2023-04-04 21:56:44 UTC
Size:
1.93 KB
patch
obsolete
>From 3865943eb669fd269f1aa97f658775cb1ba7e508 Mon Sep 17 00:00:00 2001 >From: Janusz Kaczmarek <januszop@gmail.com> >Date: Mon, 13 Mar 2023 15:06:52 +0100 >Subject: [PATCH] Bug 33210: (Bug 31963 follow-up) No hold fee message on OPAC > should be displayed when there is no fee > >After resolving Bug 31963 everything works as expected when there is >hold fee defined (!= 0). But in case when the fee for given patron >category is set to 0.00, the user will always see the message "You will >be charged a hold fee of 0,00 ...", which is obviously not intended. > >This is because categories.reservefee is returned from database as >'0.000000' and as such, without type casting, is interpreted as string >in Perl. Prior to Bug 31963 the result was compared to 0 before sending >anything to the template, so the casting was done, now it is not. > >To test: >======== >1. Go to Administration -> Patron categories >2. Edit your patron category and give a hold fee of 0. >3. HoldFeeMode does not matter - you can set it to any value. >4. In another tab, open the OPAC. >5. Search the OPAC for any record with an item. >6. Go to place a hold on this record. You will see "You will be > charged a hold fee of 0,00" --> This is a bug. >7. Apply patch and restart services. >6. Repeat step 6. >8. You should NOT see the hold fee message. > >Signed-off-by: David Nind <david@davidnind.com> >--- > C4/Reserves.pm | 1 + > 1 file changed, 1 insertion(+) > >diff --git a/C4/Reserves.pm b/C4/Reserves.pm >index 987543e1cd..84aa00e864 100644 >--- a/C4/Reserves.pm >+++ b/C4/Reserves.pm >@@ -763,6 +763,7 @@ SELECT COUNT(*) FROM reserves WHERE biblionumber=? AND borrowernumber<>? > > my $dbh = C4::Context->dbh; > my ( $fee ) = $dbh->selectrow_array( $borquery, undef, ($borrowernumber) ); >+ $fee += 0; > my $hold_fee_mode = C4::Context->preference('HoldFeeMode') || 'not_always'; > if( $fee and $fee > 0 and $hold_fee_mode eq 'not_always' ) { > # This is a reconstruction of the old code: >-- >2.30.2
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 33210
:
148120
|
148149
|
148676
|
149144
|
149145
|
149769
|
149770