== Reproduce == 1. Use staff:/cgi-bin/koha/reports/manager.pl?report_name=itemtypes 2. Change the syspref item-level_itypes 3. One case should give a 0 result == Cause == There is a conditional but part of the SQL query was copy pasted without being changed. == Fix == "SELECT itemtype" → "SELECT biblioitems.itemtype" in these two lines https://gitlab.com/koha-community/Koha/blob/673a40d2acc5c8c58b7f3e7e6d11c329d0587fc6/reports/itemtypes.plugin#L46 https://gitlab.com/koha-community/Koha/blob/673a40d2acc5c8c58b7f3e7e6d11c329d0587fc6/reports/itemtypes.plugin#L68 (or maybe the other ones)
Created attachment 84032 [details] [review] Bug 20274 When the system preference for item-level_itypes changed, it gave a zero result. 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
Created attachment 84138 [details] [review] Bug 20274 When the system preference for item-level_itypes changed, it gives a zero result. 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>
Created attachment 84144 [details] [review] Bug 20274: Itemtypes report gives zero results if item-level_itypes set to bibliographic records 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>
Good fix! For next patch: please make sure the commit subject (the first line) follows the guidelines. You can run the qa script yourself before submitting so you can fix that!
Awesome work all! Pushed to master for 19.05
Pushed to 18.11.x for 18.11.03
pushed to 18.05.x for 18.05.09
Ok for this patch. But I think this file needs more work. I see : while (($itemtype, $description,$biblioitems,$total) = $sth->fetchrow) So first var is the item type. $biblioitems seems unused. This code is confusing.
Pushed to 17.11.x for 17.11.15