MBS-7555: ISE when changing series order numbering
mwiencek
Branch: mwiencek/musicbrainz-server:mbs-7555
Branch: metabrainz/musicbrainz-server:master
Merged
Merged pull request
Merge remote-tracking branch 'bitmap/mbs-7555' into hotfix2-2014-05
Merge remote-tracking branch 'bitmap/mbs-7555' into hotfix2-2014-05
There's several issues being fixed here:
If a
link_order
value is passed toEdit::Relationship::Edit
, it'll ISE because the edit data doesn't support anylink_order
property (onlyEdit::Relationship::Create
andEdit::Relationship::Reorder
do). Now the property is ignored.If text attributes were removed from a relationship,
Edit::Relationship::Edit
would delete theattribute_text_values
property because it's empty. This was wrong, because theaccept
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 forattribute_text_values
if it's empty and theattribute_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 emptyattributes
array and a non-emptyattribute_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 sureattributes
andattribute_text_values
agree with eachother.