Bug 11163

Summary: Wrong itemtype usage count when deleting an itemtype
Product: Koha Reporter: Tomás Cohen Arazi <tomascohen>
Component: System AdministrationAssignee: Bugs List <koha-bugs>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: minor    
Priority: P5 - low CC: gmcharlt
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Bug 11163: Wrong itemtype usage count when deleting an itemtype
[SIGNED-OFF] Bug 11163: Wrong itemtype usage count when deleting an itemtype
Bug 11163: Wrong itemtype usage count when deleting an itemtype

Description Tomás Cohen Arazi 2013-10-29 21:36:35 UTC
No matter how much biblios or items use an itemtype the count is always 1.

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.
Comment 1 Tomás Cohen Arazi 2013-10-29 21:41:09 UTC Comment hidden (obsolete)
Comment 2 Owen Leonard 2013-11-14 16:41:58 UTC Comment hidden (obsolete)
Comment 3 Jonathan Druart 2013-11-15 09:23:49 UTC
Created attachment 22954 [details] [review]
Bug 11163: Wrong 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.

Regards
To+

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Comment 4 Galen Charlton 2013-11-15 15:36:10 UTC
Pushed to master and 3.14.x.  Thanks, Tomás!
Comment 5 Tomás Cohen Arazi 2013-12-08 15:06:42 UTC
This patch has been pushed to 3.12.x, will be in 3.12.8.