Bug 21946: (follow-up) Restore join to biblioitems
authorNick Clemens <nick@bywatersolutions.com>
Mon, 3 Aug 2020 12:27:15 +0000 (12:27 +0000)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 13 Aug 2020 08:13:14 +0000 (10:13 +0200)
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

C4/Circulation.pm

index 58b2416..76aebdf 100644 (file)
@@ -460,7 +460,8 @@ sub TooMany {
             if (C4::Context->preference('item-level_itypes')) {
                 $count_query .= " WHERE items.itype NOT IN ( $issuing_itemtypes_query )";
             } else {
-                $count_query .= " WHERE biblioitems.itemtype NOT IN ( $issuing_itemtypes_query )";
+                $count_query .= " JOIN biblioitems USING (biblionumber)
+                                  WHERE biblioitems.itemtype NOT IN ( $issuing_itemtypes_query )";
             }
             push @bind_params, $maxissueqty_rule->branchcode;
             push @bind_params, $maxissueqty_rule->categorycode;