Uploaded image for project: 'MusicBrainz Server'
  1. MusicBrainz Server
  2. MBS-9931

Fail gracefully when trying to remove a relationship which is in use as an example

XMLWordPrintable

      The relationship below is the example for https://musicbrainz.org/relationship/6578f0e9-1ace-4095-9de8-6e517ddb1ceb and can't be removed. There's no indication of that to the user though, and the edit remains open forever.


      Edit 57208916 produces the following error when the approval button is selected. The problem may also be stopping the edit from closing normally.

       

      Caught exception in MusicBrainz::Server::Controller::Edit->approve "Failed query:
      	'DELETE FROM l_release_group_url
                          WHERE id IN (?)'
      	(9841)
      23503 DBD::Pg::st execute failed: ERROR:  update or delete on table "l_release_group_url" violates foreign key constraint "l_release_group_url_example_fk_id" on table "l_release_group_url_example"
      DETAIL:  Key (id)=(9841) is still referenced from table "l_release_group_url_example". [for Statement "DELETE FROM l_release_group_url
                          WHERE id IN (?)" with ParamValues: 1='9841']
       at lib/Sql.pm line 115.
      

            reosarevok Nicolás Tamargo
            chiark Chiark
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                Version Package
                2020-06-15