Details
-
Bug
-
Resolution: Fixed
-
Medium
-
4.7.0, 5.0
-
None
-
OS : debian 7.4
php 5.3.28-1~dotdeb
mysql 5.5.35
apache 2.2.22
eZ Publish 4.7.0
Description
The issue is not visible in the case of reverse relation.
In the case of direct relatio, if the IgnoreVisibility param is given to FALSE, the result is not good.
In the method eZContentObject::relatedObjectCount(), the definition of $showInvisibleNodesCond is the following :
$showInvisibleNodesCond = self::createFilterByVisibilitySQLString( $params['IgnoreVisibility'], 'inner_object' );
And it can be advantageously changed to the following :
$showInvisibleNodesCond = self::createFilterByVisibilitySQLString( $params['IgnoreVisibility'], $reverseRelatedObjects ? 'inner_object' : 'outer_object' );
Since inner_objet represents the source while outer_objet represents the target of the relationship, in the case of direct relationship, we want to check the visibility of the target, but not of the source !
On the other side, in the case of reverse relationships, outer_object and inner_object both represent the source object of the SQL query, and they could be interchanged on the condition $showInvisibleNodesCond without changing the result. (the SQL query is not symmetric)
Attachments
Issue Links
- links to