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

Kernel issue: By doing a subtree copy with subitems using ObjectRelation, the Relation is broken on the copy until you republish it.

    XMLWordPrintable

    Details

      Description

      Steps to reproduce:

      1. Prepare a new test installation, fully updated;
      2. In admin interface, create a new class:

      Name: 5272
      Identifier: 5272
      
      Attributes:
      
      Attribute Type: Text line
      • Name: Title
      • Identifier: title
      • Is required: checked
      
      Attribute Type: Content relation (single)
      • Name: Related
      • Identifier: related
      

      3. Define test content structure:

      Home
      	Folder 1 (content_id: 52, location_id: 54)
      		5272 Item 1 (content_id: 53, location_id: 55)
      	Folder 2 (content_id: 54, location_id: 56)
      		Article 1 (content_id: 55, location_id: 57)
      

      4. Relate "Folder 1/5252 Item 1" with "Folder 2/Article 1";
      5. Check the 'ezcontentobject_link' table:

      mysql> SELECT * FROM ezcontentobject_link;
      +--------------------------+-----------------------+----------------------------+----+---------------+---------------------+
      | contentclassattribute_id | from_contentobject_id | from_contentobject_version | id | relation_type | to_contentobject_id |
      +--------------------------+-----------------------+----------------------------+----+---------------+---------------------+
      |                      184 |                    53 |                          2 |  1 |             8 |                  55 |
      +--------------------------+-----------------------+----------------------------+----+---------------+---------------------+
      1 row in set (0.00 sec)
      

      6. Using the Public API, perform a "Home/Folder 1" subtree copy;

      Ref: https://github.com/ezsystems/CookbookBundle/blob/master/Command/SubtreeCommand.php

      The content structure now is:

      Home
      	Folder 1 (content_id: 52, location_id: 54)
      		5272 Item 1 (content_id: 53, location_id: 55)
      	Folder 2 (content_id: 54, location_id: 56)
      		Article 1 (content_id: 55, location_id: 57)
      	Folder 1 (content_id: 56, location_id: 58)
      		5272 Item 1 (content_id: 57, location_id: 59)
      

      7. Check the 'ezcontentobject_link' table again - there should be a new record for the new relation (5272 Item 1 (content_id: 57, location_id: 59) -> Article 1 (content_id: 55, location_id: 57)), but there is not.

      Additional test:

      1. Using the Public API, edit and publish the newly copied "Folder 1/5272 Item 1" content, without modifying anything;

      Ref: https://github.com/ezsystems/CookbookBundle/blob/master/Command/UpdateContentCommand.php

      2. Check the 'ezcontentobject_link' table, which is now correct:

      mysql> SELECT * FROM ezcontentobject_link;
      +--------------------------+-----------------------+----------------------------+----+---------------+---------------------+
      | contentclassattribute_id | from_contentobject_id | from_contentobject_version | id | relation_type | to_contentobject_id |
      +--------------------------+-----------------------+----------------------------+----+---------------+---------------------+
      |                      184 |                    53 |                          2 |  1 |             8 |                  55 |
      |                      184 |                    57 |                          3 |  2 |             8 |                  55 |
      +--------------------------+-----------------------+----------------------------+----+---------------+---------------------+
      2 rows in set (0.00 sec)
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              nuno.oliveira-obsolete@ez.no Nuno Oliveira (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: