/
Wrong ListSQLs configuration for reviews

Wrong ListSQLs configuration for reviews

Currently new joins are added to review ListSQLs without line breaks:

ReviewsEventHandler
$list_sqls[''] .= ' LEFT JOIN '.$item_table.' item_table ON item_table.ResourceId = %1$s.ItemId';
$list_sqls[''] .= ' LEFT JOIN '.$ci_table.' ci ON item_table.ResourceId = ci.ItemResourceId AND ci.PrimaryCat = 1';

 

As result, LeftJoinOptimizer may work incorrectly. It detects only one join (that code consists of 2 joins - users + item table). And, if users table alias is not protected, both joins are deleted. If fields from item table join are used for filtering - SQL error happens.

Solution

Add line breaks to ListSQLs configuration

Related Tasks

INP-1728 - Getting issue details... STATUS