Bug 21946: (follow-up) Restore join to biblioitems
[koha.git] / 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;