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

"swap node" function can swap container and non-container nodes (invalid state)

    Details

      Description

      The 'Swap with another node' function in the administration interface swaps two nodes (not subtrees).

      When one of the objects (A) is a container, with children, and the other (B) is not, the result will be an incoherent state:
      B will display a children count such as " Sub items ", but instead of the children will show the message "The <ClassName> class is not configured to contain any sub items."

      Steps to reproduce:
      • Create or modify a class, and uncheck the "Container" checkbox.
      • Create a new object of this type (NodeA)
      • Create a Folder object (NodeB), and add at least one child node to it.
      • Swap NodeA with NodeB using the node's cogwheel > Advanced > Swap with another node.

      Verify that NodeA should not have any children (not container) but does display a Sub Item count.

      Note:

      Its possible the same issue may be triggered from a script, for example; in which case the solution should ideally contemplate it as well.

        Activity

        Joao Inacio (Inactive) created issue -
        Joao Inacio (Inactive) made changes -
        Field Original Value New Value
        Status Open [ 1 ] Confirmed [ 10037 ]
        Paulo Lopes (Inactive) made changes -
        Status Confirmed [ 10037 ] InputQ [ 10001 ]
        Joao Inacio (Inactive) made changes -
        Description The 'Swap with another node' function in the administration interface swaps two nodes (not subtrees).

        When one of the objects (A) is a container, with children, and the other (B) is not, the result will be an incoherent state:
        B will display a children count such as " Sub items (n)", but instead of the children will show the message "The <ClassName> class is not configured to contain any sub items."

        h5. Steps to reproduce:
        * Create or modify a class, and uncheck the "Container" checkbox.
        * Create a new object of this type (NodeA)
        * Create a Folder object (NodeB), and add at least one child node to it.
        * Swap NodeA with NodeB using the node's cogwheel > Advanced > Swap with another node.

        Verify that NodeA should not have any children (not container) but does display a Sub Item count.
        The 'Swap with another node' function in the administration interface swaps two nodes (not subtrees).

        When one of the objects (A) is a container, with children, and the other (B) is not, the result will be an incoherent state:
        B will display a children count such as " Sub items (n)", but instead of the children will show the message "The <ClassName> class is not configured to contain any sub items."

        h5. Steps to reproduce:
        * Create or modify a class, and uncheck the "Container" checkbox.
        * Create a new object of this type (NodeA)
        * Create a Folder object (NodeB), and add at least one child node to it.
        * Swap NodeA with NodeB using the node's cogwheel > Advanced > Swap with another node.

        Verify that NodeA should not have any children (not container) but does display a Sub Item count.

        h5. Note:
        Its possible the same issue may be triggered from a script, for example; in which case the solution should ideally contemplate it as well.
        Gunnstein Lye logged work - 24/Jul/14 12:00 PM
        • Time Spent:
          2 hours
           

          .

        Gunnstein Lye made changes -
        Assignee Gunnstein Lye [ gunnstein.lye@ez.no ]
        Gunnstein Lye made changes -
        Status InputQ [ 10001 ] Development [ 3 ]
        Gunnstein Lye made changes -
        Remaining Estimate 0 minutes [ 0 ]
        Time Spent 2 hours [ 7200 ]
        Worklog Id 49513 [ 49513 ]
        Gunnstein Lye logged work - 25/Jul/14 11:00 AM
        • Time Spent:
          6 hours
           

          .

        Hide
        Gunnstein Lye added a comment -

        Ref. Joao's pull request https://github.com/ezsystems/ezpublish-legacy/pull/1032
        I tried to find a way to prevent this in the UI, i.e. make nodes unselectable when they are affected by this problem, but didn't see a way that didn't require a large rewrite (eZContentBrowse::browse() doesn't allow this kind of customisation). And I don't think this somewhat obscure issue is worth a major rewrite. The error/warning in the proposed PR should be enough.

        Show
        Gunnstein Lye added a comment - Ref. Joao's pull request https://github.com/ezsystems/ezpublish-legacy/pull/1032 I tried to find a way to prevent this in the UI, i.e. make nodes unselectable when they are affected by this problem, but didn't see a way that didn't require a large rewrite (eZContentBrowse::browse() doesn't allow this kind of customisation). And I don't think this somewhat obscure issue is worth a major rewrite. The error/warning in the proposed PR should be enough.
        Hide
        Gunnstein Lye added a comment -

        Attached a way to make nodes unselectable when they are affected by this problem. This modifies template code only, so will have to be redone if the admin templates are overridden.

        Show
        Gunnstein Lye added a comment - Attached a way to make nodes unselectable when they are affected by this problem. This modifies template code only, so will have to be redone if the admin templates are overridden.
        Gunnstein Lye made changes -
        Gunnstein Lye made changes -
        Time Spent 2 hours [ 7200 ] 1 day [ 28800 ]
        Worklog Id 49520 [ 49520 ]
        Gunnstein Lye made changes -
        Status Development [ 3 ] Development review [ 10006 ]
        Gunnstein Lye logged work - 28/Jul/14 1:02 PM
        • Time Spent:
          1 hour
           

          .

        Gunnstein Lye made changes -
        Time Spent 1 day [ 28800 ] 1 day, 1 hour [ 32400 ]
        Worklog Id 49525 [ 49525 ]
        Hide
        Gunnstein Lye added a comment -

        Attached v2 of the template fix, same functionality but a little easier to read since it does not modify the original if statement.

        Show
        Gunnstein Lye added a comment - Attached v2 of the template fix, same functionality but a little easier to read since it does not modify the original if statement.
        Gunnstein Lye made changes -
        Gunnstein Lye logged work - 29/Jul/14 12:00 PM
        • Time Spent:
          1 hour
           

          .

        Gunnstein Lye made changes -
        Time Spent 1 day, 1 hour [ 32400 ] 1 day, 2 hours [ 36000 ]
        Worklog Id 49547 [ 49547 ]
        Gunnstein Lye logged work - 30/Jul/14 11:40 AM
        • Time Spent:
          1 hour
           

          .

        Gunnstein Lye made changes -
        Status Development review [ 10006 ] Development Review done [ 10028 ]
        Show
        Gunnstein Lye added a comment - Merged Joao's PR into master: https://github.com/ezsystems/ezpublish-legacy/commit/dd3d96a2f6d7c493705627f5f30f54b9dce335f7
        Gunnstein Lye made changes -
        Time Spent 1 day, 2 hours [ 36000 ] 1 day, 3 hours [ 39600 ]
        Worklog Id 49576 [ 49576 ]
        Gunnstein Lye made changes -
        Time Spent 1 day, 3 hours [ 39600 ] 1 day, 3 hours, 30 minutes [ 41400 ]
        Worklog Id 49583 [ 49583 ]
        Gunnstein Lye made changes -
        Status Development Review done [ 10028 ] Documentation done [ 10011 ]
        Fix Version/s 4.7 Maintenance [ 12583 ]
        Fix Version/s 5.0 Maintenance [ 11287 ]
        Fix Version/s 5.1 Maintenance [ 12301 ]
        Fix Version/s 5.2 Maintenance [ 12782 ]
        Fix Version/s 5.3.3 [ 13484 ]
        Gunnstein Lye made changes -
        Assignee Gunnstein Lye [ gunnstein.lye@ez.no ]
        Paulo Nunes (Inactive) made changes -
        Status Documentation done [ 10011 ] QA [ 10008 ]
        Assignee Paulo Nunes [ paulo.nunes@ez.no ]
        Gunnstein Lye logged work - 31/Jul/14 10:45 AM - edited
        • Time Spent:
          1 hour
           

          .

        Paulo Nunes (Inactive) made changes -
        Flagged Impediment [ 10000 ]
        Gunnstein Lye made changes -
        Time Spent 1 day, 3 hours, 30 minutes [ 41400 ] 1 day, 4 hours [ 43200 ]
        Worklog Id 49583 [ 49583 ]
        Paulo Nunes (Inactive) made changes -
        Flagged Impediment [ 10000 ]
        Hide
        Paulo Nunes (Inactive) added a comment -

        QA Approved

        Tested on eZ Publish 4.7, 5.0, 5.1, 5.2, 5.3 and master

        Show
        Paulo Nunes (Inactive) added a comment - QA Approved Tested on eZ Publish 4.7, 5.0, 5.1, 5.2, 5.3 and master
        Paulo Nunes (Inactive) made changes -
        Assignee Paulo Nunes [ paulo.nunes@ez.no ]
        Status QA [ 10008 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]
        André Rømcke made changes -
        Workflow eZ Engineering Scrumban Workflow [ 63959 ] EZ* Development Workflow [ 85230 ]
        Alex Schuster made changes -
        Workflow EZ* Development Workflow [ 85230 ] EZEE Development Workflow [ 124026 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Confirmed Confirmed
        42s 1 joao.inacio@ez.no 17/Jul/14 3:56 PM
        Confirmed Confirmed InputQ InputQ
        20m 38s 1 Paulo Lopes (Inactive) 17/Jul/14 4:17 PM
        InputQ InputQ Development Development
        7d 33m 1 Gunnstein Lye 24/Jul/14 4:50 PM
        Development Development Development Review Development Review
        3d 17h 57m 1 Gunnstein Lye 28/Jul/14 10:48 AM
        Development Review Development Review Development Review done Development Review done
        2d 5h 21m 1 Gunnstein Lye 30/Jul/14 4:09 PM
        Development Review done Development Review done Documentation Review done Documentation Review done
        17h 43m 1 Gunnstein Lye 31/Jul/14 9:52 AM
        Documentation Review done Documentation Review done QA QA
        29m 56s 1 Paulo Nunes 31/Jul/14 10:22 AM
        QA QA Closed Closed
        23h 1 Paulo Nunes 01/Aug/14 9:23 AM

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - Not Specified
              Not Specified
              Remaining:
              Remaining Estimate - 0 minutes
              0m
              Logged:
              Time Spent - 1 day, 4 hours
              1d 4h