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

multiple results of nodes in fetch tree if using Role policy 'content -> read -> group -> self'

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Medium Medium
    • 3.10.0rc1
    • 3.9.2, 3.9.3
    • None
    • Operating System: linux
      PHP Version: (please be specific, like '4.4.3' or '5.1.5') 4,4
      Database and version: mysql 5
      Browser (and version):

    Description

      if you use the condition

      content -> read -> group -> self

      you get multiple node results in fetch functions tree, tree_count, list ...

      I fix it up by adding a 'DISTINCT' statement, see patch:

      revision 119 = ez 3.9.2
      revision 121 is my patched version

      Index: /ez/trunk/patches/kernel/classes/ezcontentobjecttreenode.php
      ===================================================================
      — /ez/trunk/patches/kernel/classes/ezcontentobjecttreenode.php (revision 119)
      +++ /ez/trunk/patches/kernel/classes/ezcontentobjecttreenode.php (revision 121)
      @@ -1818,6 +1818,6 @@
      // Determine whether we should show invisible nodes.
      $showInvisibleNodesCond = eZContentObjectTreeNode::createShowInvisibleSQLString( !$ignoreVisibility );
      -

      • $query = "SELECT ezcontentobject.*,
        +//patch Felix (DISTINCT)
        + $query = "SELECT DISTINCT ezcontentobject.*,
        ezcontentobject_tree.*,
        ezcontentclass.serialized_name_list as class_serialized_name_list,
        @@ -2769,6 +2769,6 @@
        $sqlPermissionChecking = array( 'from' => $sqlPermissionCheckingFrom,
        'where' => $sqlPermissionCheckingWhere );
        -
      • $query = "SELECT count as count
        +// Patch Felix count => count(DISTINCT ezcontentobject_tree.node_id)
        + $query = "SELECT count(DISTINCT ezcontentobject_tree.node_id) as count
        FROM
        ezcontentobject_tree,
        @@ -2798,5 +2798,5 @@
        {
        $query="SELECT
      • count AS count
        + count(DISTINCT ezcontentobject_tree.node_id) AS count
        FROM
        ezcontentobject_tree,
        Steps to reproduce

        Adding to a role the policy

      content -> read -> group -> self

      Login a user with is assigned to this group, then all fetches e.g. fetch('content', 'tree' ...
      get multiple results of the same nodes.

      Attachments

        Activity

          People

            rl rl
            4d91e976-d41f-487b-ae85-f7216bd06dac@accounts.ibexa.co Felix Woldt
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: