From 8af539b108cd7d9b92d905557fbd4994be197a20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joonas=20Kylm=C3=A4l=C3=A4?= Date: Wed, 4 Nov 2020 17:00:02 +0200 Subject: [PATCH] Bug 26132: (follow-up) Add test to show errors in max issues amount calculation If you set default branch limits for issue quantity circulation rules you will get errors when calling TooMany function. To reproduce the error: 1) Apply this patch 2) Run prove t/db_dependent/Circulation/TooMany.t and notice the following error: No method count found for Koha::Checkouts DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Unknown column 'item.homebranch' in 'where clause' [...] --- t/db_dependent/Circulation/TooMany.t | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/t/db_dependent/Circulation/TooMany.t b/t/db_dependent/Circulation/TooMany.t index 0f4843b822..d1663d98a3 100755 --- a/t/db_dependent/Circulation/TooMany.t +++ b/t/db_dependent/Circulation/TooMany.t @@ -505,6 +505,18 @@ subtest 'General vs specific rules limit quantity correctly' => sub { } ); + # Set default maximum issue quantity limits for branch + Koha::CirculationRules->set_rules( + { + branchcode => $branch->{branchcode}, + categorycode => '*', + rules => { + patron_maxissueqty => 1, + patron_maxonsiteissueqty => 1, + } + } + ); + # Set an All->All for an itemtype Koha::CirculationRules->set_rules( { -- 2.11.0