From 37cc2b2caea1789b5f08c4cfe49488c4d5892342 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com>
Date: Mon, 17 Dec 2012 11:52:26 +0100
Subject: [PATCH] Add "explicit join support" to the parent_strict_group
 related key

---
 .../z_related_parent_strict_group.xml                 | 11 ++++++-----
 .../bootstrap/erp5_mysql_innodb_catalog/bt/revision   |  2 +-
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/product/ERP5/bootstrap/erp5_mysql_innodb_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_related_parent_strict_group.xml b/product/ERP5/bootstrap/erp5_mysql_innodb_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_related_parent_strict_group.xml
index 9179a64e5e..6ab7a1517f 100644
--- a/product/ERP5/bootstrap/erp5_mysql_innodb_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_related_parent_strict_group.xml
+++ b/product/ERP5/bootstrap/erp5_mysql_innodb_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_related_parent_strict_group.xml
@@ -14,8 +14,10 @@
         </item>
         <item>
             <key> <string>arguments_src</string> </key>
-            <value> <string>table_0\r\n
-table_1</string> </value>
+            <value> <string>query_table\r\n
+table_0\r\n
+table_1\r\n
+RELATED_QUERY_SEPARATOR=" AND "</string> </value>
         </item>
         <item>
             <key> <string>cache_time_</string> </key>
@@ -56,10 +58,9 @@ table_1</string> </value>
             <value> <string encoding="cdata"><![CDATA[
 
 <dtml-var table_1>.uid = <dtml-var table_0>.category_uid\n
-AND <dtml-var table_0>.base_category_uid = <dtml-var "portal_categories.group.getUid()">\n
-AND <dtml-var table_0>.uid = catalog.parent_uid\n
+<dtml-var RELATED_QUERY_SEPARATOR> <dtml-var table_0>.base_category_uid = <dtml-var "portal_categories.group.getUid()">\n
+AND <dtml-var table_0>.uid = <dtml-var query_table>.parent_uid\n
 AND <dtml-var table_0>.category_strict_membership = 1\n
-\n
 
 
 ]]></string> </value>
diff --git a/product/ERP5/bootstrap/erp5_mysql_innodb_catalog/bt/revision b/product/ERP5/bootstrap/erp5_mysql_innodb_catalog/bt/revision
index df689d8406..c72784c8c5 100644
--- a/product/ERP5/bootstrap/erp5_mysql_innodb_catalog/bt/revision
+++ b/product/ERP5/bootstrap/erp5_mysql_innodb_catalog/bt/revision
@@ -1 +1 @@
-234
\ No newline at end of file
+235
\ No newline at end of file
-- 
2.30.9