From: Tomas Cohen Arazi Date: Tue, 29 Oct 2013 21:39:22 +0000 (-0300) Subject: Bug 11163: display correct itemtype usage count when deleting an itemtype X-Git-Tag: v3.14.00~7^2 X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=commitdiff_plain;h=39a656c6ba555a542d468e47874be52223402c21;p=koha_fer Bug 11163: display correct itemtype usage count when deleting an itemtype Wrong usage of UNION instead of UNION ALL prevented the count to match the expected value. Steps to reproduce: - Create an itemtype. - Create some biblios setting the created itemtype at biblio level. - Create some items setting the created itemtype on them. - Try to delete the itemtype in Home > Administration > Item types, the count is 1 and doesn't match the expected result. Signed-off-by: Owen Leonard Signed-off-by: Jonathan Druart Signed-off-by: Galen Charlton --- diff --git a/admin/itemtypes.pl b/admin/itemtypes.pl index ee7023810c..3c33073cbb 100755 --- a/admin/itemtypes.pl +++ b/admin/itemtypes.pl @@ -200,7 +200,7 @@ elsif ( $op eq 'delete_confirm' ) { my $sth = $dbh->prepare(' SELECT COUNT(*) AS total FROM ( SELECT itemtype AS t FROM biblioitems - UNION + UNION ALL SELECT itype AS t FROM items ) AS tmp WHERE tmp.t=?