Bug 6436 - Don't allow deletion of an itemtype used in items.itype
Summary: Don't allow deletion of an itemtype used in items.itype
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: System Administration (show other bugs)
Version: 3.4
Hardware: All All
: PATCH-Sent (DO NOT USE) normal
Assignee: Fridolin Somers
QA Contact: Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-31 13:15 UTC by Fridolin Somers
Modified: 2012-10-26 00:42 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Proposed patch (1.35 KB, patch)
2011-05-31 13:33 UTC, Fridolin Somers
Details | Diff | Splinter Review
Signed-off patch (1.45 KB, patch)
2011-05-31 20:16 UTC, Owen Leonard
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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.