Opened 5 years ago

Closed 5 years ago

#2065 closed defect (fixed)

Exception when trying to delete a data file type that is referenced from item subtype

Reported by: Nicklas Nordborg Owned by: Nicklas Nordborg
Priority: minor Milestone: BASE 3.11
Component: core Version:
Keywords: Cc:

Description (last modified by Nicklas Nordborg)

We have an item subtype and a data file type. The item subtype has been configured with a reference to the data file type.

When trying to delete the data file type there is no indication that it is used in the trashcan. This results in the following exception:

update or delete on table "DataFileTypes" 
violates foreign key constraint "FKmnjqbi7ofj7k0bam7cyh5t3k5" 
on table "ItemSubtypeFileTypes"
Detail: Key (id)=(204867) is still referenced from table "ItemSubtypeFileTypes".

The workaround is to manually remove the link between the item subtype and the data file type. This is done from the item subtype edit dialog.

Change History (3)

comment:1 Changed 5 years ago by Nicklas Nordborg

Description: modified (diff)
Owner: changed from everyone to Nicklas Nordborg
Status: newassigned

comment:2 Changed 5 years ago by Nicklas Nordborg

Summary: Can't delete data file type that is referenced from item subtypeException when trying to delete a data file type that is referenced from item subtype

UPDATE:

It should not be possible to delete the data file type without first removing the link. The traschcan should display the item subtype that is referencing the data file type.

comment:3 Changed 5 years ago by Nicklas Nordborg

Resolution: fixed
Status: assignedclosed

(In [7312]) Fixes #2065: Exception when trying to delete a data file type that is referenced from item subtype

The item subtype should now be displayed in the trashcan under the "Items using" section.

Note: See TracTickets for help on using tickets.