Details

      Description

      When editing and publishing new object version with relation fields, the old (obsolete) relations are not cleared.

      Steps to reproduce
      • 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.
      Expected result:

      In object's "relations" tab, it should only show "A2" and "B",

      Actual result:

      In object's "relations" tab, objects "A", "A2" and "B" are shown.

      Further Notes:

      The behavior seems a regression caused by EZP-24530

        Issue Links

          Activity

          Hide
          Joao Inacio (Inactive) added a comment - - edited
          Summary:

          When editing (translatable) relation(s), only the relations for the published versions (of any language) should remain in the object relations table.

          Issue:

          There have been two different behaviors so far:
          1) Latest published version relations overwrites all relations (inclusive of other languages).
          2) Latest published version relations are added, without clearing any existing ones (EZP-24530).

          Solution:

          The fix needs to either
          1) Detect the relations exclusive to the latest published version of the language being edited and remove them, or
          2) Remove all existing relations, and re-add the ones for all existing languages except the language being edited (for which new relations will then be added).

          Considerations:
          • ezcontentobject_link table does not specify any language information.
          • In order to fetch object relations destination ids the relation xml attribute needs to be parsed.
          • Given that this is done when persisting the datatype (storeObjectAttribute), performance impact should be within reasonable limits.
          Show
          Joao Inacio (Inactive) added a comment - - edited Summary: When editing (translatable) relation(s), only the relations for the published versions (of any language) should remain in the object relations table. Issue: There have been two different behaviors so far: 1) Latest published version relations overwrites all relations (inclusive of other languages). 2) Latest published version relations are added, without clearing any existing ones ( EZP-24530 ). Solution: The fix needs to either 1) Detect the relations exclusive to the latest published version of the language being edited and remove them, or 2) Remove all existing relations, and re-add the ones for all existing languages except the language being edited (for which new relations will then be added). Considerations: ezcontentobject_link table does not specify any language information. In order to fetch object relations destination ids the relation xml attribute needs to be parsed. Given that this is done when persisting the datatype (storeObjectAttribute), performance impact should be within reasonable limits.
          Hide
          Ricardo Correia (Inactive) added a comment -

          Can we have this fix backported to 5.3?

          Show
          Ricardo Correia (Inactive) added a comment - Can we have this fix backported to 5.3?
          Hide
          Rui Silva (Inactive) added a comment -

          Tested and approved by QA for 5.3 and 5.4.

          Show
          Rui Silva (Inactive) added a comment - Tested and approved by QA for 5.3 and 5.4.

            People

            • Assignee:
              Unassigned
              Reporter:
              Joao Inacio (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: