Bug 20274: Itemtypes report gives zero results if item-level_itypes set to bibliograp...
authorhelene hickey <hickeyhe@wgc.school.nz>
Tue, 15 Jan 2019 23:07:34 +0000 (23:07 +0000)
committerFridolin Somers <fridolin.somers@biblibre.com>
Mon, 4 Feb 2019 09:51:22 +0000 (10:51 +0100)
1) Go to reports then catalog by item types
2) Pick a location and look at table
3) Change the system prefernce of item-level_itypes
4) Verify a zero result
5) Apply patch and retry
6) Verify that result does not change to zero on either preference

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 8ad2c206cba1b737e69393e2e3cd92076fb94e17)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit d8194f17e43da3b17a6b9dc3c8643a471a748c36)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit da94385c99d547cf995f5a779e48208e1f53d539)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>

reports/itemtypes.plugin

index ffa6fb7..6884369 100755 (executable)
@@ -53,7 +53,7 @@ sub calculate {
                }
                else {
                $sth = $dbh->prepare("
-        SELECT itemtype, description, biblioitems.itemtype, COUNT(*) AS total
+        SELECT biblioitems.itemtype, description, biblioitems.itemtype, COUNT(*) AS total
                        FROM itemtypes, biblioitems, items 
                WHERE biblioitems.itemtype=itemtypes.itemtype 
                AND items.biblioitemnumber=biblioitems.biblioitemnumber
@@ -65,7 +65,7 @@ sub calculate {
        } else {
                if (C4::Context->preference('item-level_itypes')) {
                $sth = $dbh->prepare("
-        SELECT itemtype, description,items.itype AS itemtype, COUNT(*) AS total
+        SELECT biblioitems.itemtype, description,items.itype AS itemtype, COUNT(*) AS total
                        FROM itemtypes,items
                WHERE items.itype=itemtypes.itemtype
                        GROUP BY items.itype