ezsystems/ezpublish-legacy — pull request #889 by achasseux (2014-02-23 21:54:25+00:00)
Title: EZP-22399 : When calling the method eZContentObject::relatedObjectCount with the IgnoreVisibility parameter, the count is not correct

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).