Bug 11163: display correct itemtype usage count when deleting an itemtype
authorTomas Cohen Arazi <tomascohen@gmail.com>
Tue, 29 Oct 2013 21:39:22 +0000 (18:39 -0300)
committerGalen Charlton <gmc@esilibrary.com>
Fri, 15 Nov 2013 15:34:33 +0000 (15:34 +0000)
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 <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
admin/itemtypes.pl

index ee70238..3c33073 100755 (executable)
@@ -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=?