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

Relationship editing code is complex and subtly duplicating

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Normal Normal
    • None
    • None
    • None

      Controller::Edit::Relationship, specifically. Even aside from the fact there's create, create_url, and edit (no edit_url – apparently that one didn't need special treatment?), the three are very similar in general structure: figure out values to use and validate/check permissions, check seeding (though that seems to be missing from edit... probably because of this problem), then either try_and_insert or try_and_edit (which seem to be fairly similar functions themselves, in that they check for duplicates then insert an edit) within a transaction after flattening attributes and resolving any direction problems. Then redirect. Of course, this whole pattern is basically what Controller::edit_action does too, with some extra complications at inconvenient points in the process.

      We should really be getting rid of this sort of thing.

            Unassigned Unassigned
            ianmcorvidae Ian McEwen
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

                Version Package