Bug 6436

Summary: Don't allow deletion of an itemtype used in items.itype
Product: Koha Reporter: Fridolin Somers <fridolin.somers>
Component: System AdministrationAssignee: Fridolin Somers <fridolin.somers>
Status: CLOSED FIXED QA Contact: Bugs List <koha-bugs>
Severity: normal    
Priority: PATCH-Sent (DO NOT USE) CC: chris, gmcharlt
Version: 3.4   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Proposed patch
Signed-off patch

Description Fridolin Somers 2011-05-31 13:15:28 UTC
When trying to delete an item type, the code checks if its code is used in biblioitems.itemtype and if it is, deosn't allow suppression.

But item type can also be in items.itype.

I modified code to check both locations.
Comment 1 Fridolin Somers 2011-05-31 13:33:02 UTC Comment hidden (obsolete)
Comment 2 Owen Leonard 2011-05-31 20:16:04 UTC
Created attachment 4321 [details] [review]
Signed-off patch

With the patch applied I am prevented from deleting an item type if it is in use in the biblio record or the item record.
Comment 3 Fridolin Somers 2011-06-01 07:38:57 UTC
(In reply to comment #2)
> Created attachment 4321 [details] [review]
> Signed-off patch
> 
> With the patch applied I am prevented from deleting an item type if it is in
> use in the biblio record or the item record.

Thanks,
this is an important bug I think.
Comment 4 Chris Cormack 2011-06-03 02:26:55 UTC
Pushed to master, please test
Comment 5 Fridolin Somers 2011-06-06 11:48:06 UTC
Tested : 

Create a new item type
Use it in an item
=> impossible to delete
Remove it from the item
=> delete with confirmation ok

Thanks.