This is a port of
EZP-25396 and related later fixes from 5.4 to master/2017.08.
When editing and publishing new object version with relation fields, the old (obsolete) relations are not cleared.
- Pre-condition: ContentType with relation list field.
- Create a new "Test" content (in eng-GB), add relation to object "A", publish.
- (optional: add a new version in a different language, relate to object "B", publish).
- Add a new version in the main language (eng-GB), modify the relation to use object "A2", publish.
In object's "relations" tab, it should only show "A2" and "B",
In object's "relations" tab, objects "A", "A2" and "B" are shown.
The behavior seems a regression caused by