Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-24530

edit main language of object will show related objects only from main language

    Details

      Description

      The relations used are all in the context of a relation list datatype. for tests, add a relationlist to the "article" class.
      When an object has more than one language, editing the main language will only update the related objects with the ones declared in the main translation. secondary translations add all related objects.

      test:
      1 - use a class C with a relationlist field
      2 - create a C object in ENG, add one object X (any object is good) to the relation list, publish
      3 - object C shows 1 relation in the tab
      4 - edit a new translation FRE, add two objects to list different from X, publish
      5 - relations tab shows 3 objects
      6 - edit the ENG translation, publish
      7 - relations tab shows only 1 object again, wrong

      additional information:
      using the query
      select * from ezcontentobject_link where from_contentobject_id = <id created in step 1>
      after each of the above steps, we can check that as new versions are created:

      • if the version is from main language, only the related object in that version is added.
      • if version is another language, all related objects are added.

      in test example below, the versions 1,3,5 refer to the main ENG translation:

      │+--------------------------+-----------------------+----------------------------+-----+---------------+---------------------+
      │| contentclassattribute_id | from_contentobject_id | from_contentobject_version | id  | relation_type | to_contentobject_id |
      │+--------------------------+-----------------------+----------------------------+-----+---------------+---------------------+
      │|                      524 |                  1595 |                          1 |  83 |             8 |                 626 |
      │|                      524 |                  1595 |                          2 |  93 |             8 |                 626 |
      │|                      524 |                  1595 |                          2 |  94 |             8 |                 620 |
      │|                      524 |                  1595 |                          2 |  95 |             8 |                1574 |
      │|                      524 |                  1595 |                          3 | 101 |             8 |                 626 |
      │|                      524 |                  1595 |                          4 | 108 |             8 |                 626 |
      │|                      524 |                  1595 |                          4 | 109 |             8 |                 620 |
      │|                      524 |                  1595 |                          4 | 110 |             8 |                1574 |
      │|                      524 |                  1595 |                          5 | 117 |             8 |                 626 |
      │+--------------------------+-----------------------+----------------------------+-----+---------------+---------------------+
      
      

        Issue Links

          Activity

          Hide
          Bertrand Dunogier added a comment -

          Did this problem happen before applying the patch, Andrieux Alexandre ? Or is it a consequence of applying it ?

          Show
          Bertrand Dunogier added a comment - Did this problem happen before applying the patch, Andrieux Alexandre ? Or is it a consequence of applying it ?
          Hide
          Andrieux Alexandre added a comment -

          This problem was one step of the initial problem, since we didn't got your approbation for that patch we still didn't applied it.
          As we said in https://support.ez.no/ticket/view/4958 , here are all the steps :

          Step 1:
          Create an Article1 in default language with one relation.
          Play query: select * from ezcontentobject_link where from_contentobject_id =

          {content id Article1};
          Result: 1 line
          End version 1
          --------------------------------------
          Step 2:
          Create a draft from Article1 in English (create english version of Article1)
          Play query: select * from ezcontentobject_link where from_contentobject_id = {content id Article1}

          ;
          Result: 0 line
          End draft version 2
          --------------------------------------
          Step 3:
          Publish version 2 of Article1 in English with 4 relations
          Play query: select * from ezcontentobject_link where from_contentobject_id =

          {content id Article1};
          Result: 4 lines
          End version 2
          --------------------------------------
          Step 4:
          Edit Article1 in default language (with no content edition)
          Play query: select * from ezcontentobject_link where from_contentobject_id = {content id Article1}

          ;
          Result: 5 lines
          End version 3
          --------------------------------------
          Step 5:
          Edit Article1 in English (with no content edition)
          Play query: select * from ezcontentobject_link where from_contentobject_id =

          {content id Article1};
          Result 4 lines:
          End version 4
          --------------------------------------
          Step 6:
          Create new version of Article1 in Italian with 2 relations
          Play query: select * from ezcontentobject_link where from_contentobject_id = {content id Article1}

          ;
          Result: 7 lines
          End version 5
          --------------------------------------
          Step 7:
          Edit Article1 in default language (with no content edition)
          Play query: select * from ezcontentobject_link where from_contentobject_id =

          {content id Article1};
          Result: 7 lines
          End version 6
          --------------------------------------
          Step 8:
          Edit Article1 in English (with no content edition)
          Play query: select * from ezcontentobject_link where from_contentobject_id = {content id Article1}

          ;
          Result: 4 lines
          End version 7
          --------------------------------------
          Step 9:
          Edit Article1 in Italian (with no content edition)
          Play query: select * from ezcontentobject_link where from_contentobject_id =

          {content id Article1};
          Result: 7 lines
          End version 8
          --------------------------------------
          Step 10:
          Delete Article1 in Italian
          Play query: select * from ezcontentobject_link where from_contentobject_id = {content id Article1}

          ;
          Result: 7 lines
          No new version after delete
          End version 8
          --------------------------------------
          Step 11:
          Edit Article1 in English (with no content edition)
          Play query: select * from ezcontentobject_link where from_contentobject_id =

          {content id Article1}

          ;
          Result: 4 lines
          End version 9

          Show
          Andrieux Alexandre added a comment - This problem was one step of the initial problem, since we didn't got your approbation for that patch we still didn't applied it. As we said in https://support.ez.no/ticket/view/4958 , here are all the steps : Step 1: Create an Article1 in default language with one relation. Play query: select * from ezcontentobject_link where from_contentobject_id = {content id Article1}; Result: 1 line End version 1 -------------------------------------- Step 2: Create a draft from Article1 in English (create english version of Article1) Play query: select * from ezcontentobject_link where from_contentobject_id = {content id Article1} ; Result: 0 line End draft version 2 -------------------------------------- Step 3: Publish version 2 of Article1 in English with 4 relations Play query: select * from ezcontentobject_link where from_contentobject_id = {content id Article1}; Result: 4 lines End version 2 -------------------------------------- Step 4: Edit Article1 in default language (with no content edition) Play query: select * from ezcontentobject_link where from_contentobject_id = {content id Article1} ; Result: 5 lines End version 3 -------------------------------------- Step 5: Edit Article1 in English (with no content edition) Play query: select * from ezcontentobject_link where from_contentobject_id = {content id Article1}; Result 4 lines: End version 4 -------------------------------------- Step 6: Create new version of Article1 in Italian with 2 relations Play query: select * from ezcontentobject_link where from_contentobject_id = {content id Article1} ; Result: 7 lines End version 5 -------------------------------------- Step 7: Edit Article1 in default language (with no content edition) Play query: select * from ezcontentobject_link where from_contentobject_id = {content id Article1}; Result: 7 lines End version 6 -------------------------------------- Step 8: Edit Article1 in English (with no content edition) Play query: select * from ezcontentobject_link where from_contentobject_id = {content id Article1} ; Result: 4 lines End version 7 -------------------------------------- Step 9: Edit Article1 in Italian (with no content edition) Play query: select * from ezcontentobject_link where from_contentobject_id = {content id Article1}; Result: 7 lines End version 8 -------------------------------------- Step 10: Delete Article1 in Italian Play query: select * from ezcontentobject_link where from_contentobject_id = {content id Article1} ; Result: 7 lines No new version after delete End version 8 -------------------------------------- Step 11: Edit Article1 in English (with no content edition) Play query: select * from ezcontentobject_link where from_contentobject_id = {content id Article1} ; Result: 4 lines End version 9
          Hide
          Bertrand Dunogier added a comment -

          Pull-request with the fix from above created: https://github.com/ezsystems/ezpublish-legacy/pull/1183.

          Show
          Bertrand Dunogier added a comment - Pull-request with the fix from above created: https://github.com/ezsystems/ezpublish-legacy/pull/1183 .
          Hide
          Bertrand Dunogier added a comment -

          Merged to master@b45c9d6.

          Show
          Bertrand Dunogier added a comment - Merged to master@b45c9d6 .
          Hide
          Rui Silva (Inactive) added a comment -

          Tested and approved by QA for master, 5.4 and 5.3.

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

            People

            • Assignee:
              Unassigned
              Reporter:
              Paulo Bras (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: