MBS-7555: ISE when changing series order numbering

Merged
#962 · Created  · Last updated

Merged pull request

Merge remote-tracking branch 'bitmap/mbs-7555' into hotfix2-2014-05

55f8f0c·Author: ·Closed by: ·2014-05-17

Description

There's several issues being fixed here:

  • If a link_order value is passed to Edit::Relationship::Edit, it'll ISE because the edit data doesn't support any link_order property (only Edit::Relationship::Create and Edit::Relationship::Reorder do). Now the property is ignored.

  • If text attributes were removed from a relationship, Edit::Relationship::Edit would delete the attribute_text_values property because it's empty. This was wrong, because the accept method assumes that no property = no change, and fall back to the link data: https://bitbucket.org/metabrainz/musicbrainz-server/src/316fe45212d9ca468a15d7940201e7d70cf339c7/lib/MusicBrainz/Server/Edit/Relationship/Edit.pm?at=master#cl-395 So now it includes an empty hash for attribute_text_values if it's empty and the attribute_text_values on the current link is non-empty.

  • $c->model('Link')->find_or_insert didn't do the right thing if it was passed an empty attributes array and a non-empty attribute_text_values hash. (In the case here, attribute_text_values would be passed in with undef values if the values were cleared.) So I added a _fix_attributes function that makes sure attributes and attribute_text_values agree with eachother.

0 attachments

0 comments

Loading commits...