Details
-
Bug
-
Resolution: Fixed
-
Medium
-
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.