From 1f0c8fd9bdd819f872a287538de976ccbea0cbda Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 12 Jun 2019 09:12:27 -0500 Subject: [PATCH] Bug 23104: (bug 18925 follow-up): Fix null/empty behavior, again Not kidding, it's again, and will certainly appear more. The problem is that we should have a NULL value in DB to make things more readable and logical. Now we need a quick fix. Test plan: Set "Current checkouts allowed" to unlimited (empty string) Try to check an item out => Without this patch we are blocked with a "too many" message => With this patch applied the correct behavior is back! Signed-off-by: Mark Tompsett Signed-off-by: Katrin Fischer Signed-off-by: Martin Renvoize (cherry picked from commit 8c8e36cf7abf51113654c5e1c0497f918a1cd56c) Signed-off-by: Fridolin Somers --- C4/Circulation.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 9dd1a23774..3061a8e61a 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -412,7 +412,7 @@ sub TooMany { # if a rule is found and has a loan limit set, count # how many loans the patron already has that meet that # rule - if (defined($maxissueqty_rule) and defined($maxissueqty_rule->rule_value)) { + if (defined($maxissueqty_rule) and $maxissueqty_rule->rule_value ne '') { my @bind_params; my $count_query = q| SELECT COUNT(*) AS total, COALESCE(SUM(onsite_checkout), 0) AS onsite_checkouts -- 2.39.5