Issue Details (XML | Word | Printable)

Key: MBS-1133
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Normal Normal
Assignee: Oliver Charles
Reporter: nikki
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
MusicBrainz Server

Don't try to delete relationship types that are still in use

Created: 07/Dec/10 06:11 PM   Updated: 19/Sep/11 02:59 PM   Resolved: 19/Sep/11 02:59 PM
Component/s: Misc features
Affects Version/s: NGS - Beta 3
Fix Version/s: Bug fixes, 2011-09-19


 Description  « Hide

If a relationship editor tries to delete a relationship type that's already in use, it doesn't check whether it can be deleted first, so I got an error like:

Caught exception in MusicBrainz::Server::Controller::Admin::LinkType->delete "Failed query:
'DELETE FROM link_type WHERE id = ?'
(279)
DBD::Pg::st execute failed: ERROR: update or delete on table "link_type" violates foreign key constraint "link_fk_link_type" on table "link"
DETAIL: Key (id)=(279) is still referenced from table "link". at /home/mbserver/musicbrainz/mb_server-next/script/../lib/Sql.pm line 102.

at /home/mbserver/musicbrainz/mb_server-next/script/../lib/MusicBrainz/Server/Data/LinkType.pm line 196
at /home/mbserver/musicbrainz/mb_server-next/script/../lib/MusicBrainz/Server/Controller/Admin/LinkType.pm line 144"

Probably not very high priority since only a handful of people can even edit relationship types, but we have a nice "still in use" page for relationship attributes, so I don't see why we shouldn't have one for the relationships themselves as well.



Sort Order: Ascending order - Click to sort in descending order
nikki added a comment - 07/Dec/10 06:12 PM

I have no idea why documentation was selected...


Aurélien Mino added a comment - 19/Jan/11 01:41 PM

This can wait Post-NGS, this issue is really minor and only affects relationship-editors (i.e. maximum 5 active users).

There are more important tickets (adding auto-editor elections is even more important than this one)