Commit 451bdc3c authored by Sebastien Robin's avatar Sebastien Robin

- revert the last change made by Vincent on z_catalog_predicate_category_list, and

then insert 0 values instead of null values. Nothing was inserted into the
predicate_category table by the last patch when no membership criterion category
list was definied on a predicate, so there was errors in testDomainTool.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@19697 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 6a4fc8b5
...@@ -3,11 +3,8 @@ ...@@ -3,11 +3,8 @@
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<tuple> <tuple>
<tuple> <global name="SQL" module="Products.ZSQLMethods.SQL"/>
<string>Products.ZSQLMethods.SQL</string> <tuple/>
<string>SQL</string>
</tuple>
<none/>
</tuple> </tuple>
</pickle> </pickle>
<pickle> <pickle>
...@@ -57,9 +54,9 @@ ...@@ -57,9 +54,9 @@
<key> <string>_keys</string> </key> <key> <string>_keys</string> </key>
<value> <value>
<list> <list>
<string>uid</string> <string>uid</string>
<string>predicate_property_dict</string> <string>predicate_property_dict</string>
<string>isPredicate</string> <string>isPredicate</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -125,22 +122,37 @@ WHERE\n ...@@ -125,22 +122,37 @@ WHERE\n
uid=<dtml-sqlvar sequence-item type="int"><dtml-if sequence-end><dtml-else> OR </dtml-if>\n uid=<dtml-sqlvar sequence-item type="int"><dtml-if sequence-end><dtml-else> OR </dtml-if>\n
</dtml-in>\n </dtml-in>\n
;\n ;\n
\n
<dtml-var "\'\\0\'">\n <dtml-var "\'\\0\'">\n
<dtml-let category_list="[]">\n \n
<dtml-in prefix="loop" expr="_.range(_.len(uid))">\n <dtml-let predicate_list="[]">\n
<dtml-if expr="isPredicate[loop_item] and predicate_property_dict[loop_item].has_key(\'membership_criterion_category_list\')">\n <dtml-in prefix="loop" expr="_.range(_.len(uid))">\n
<dtml-let uid_list="portal_categories.getCategoryParentUidList(predicate_property_dict[loop_item][\'membership_criterion_category_list\'])">\n <dtml-if "isPredicate[loop_item]">\n
<dtml-if uid_list>\n <dtml-call expr="predicate_list.append(loop_item)">\n
<dtml-in prefix="uid" expr="uid_list">\n </dtml-if>\n
<dtml-call expr="category_list.append((uid[loop_item], uid_item[0], uid_item[1], uid_item[2]))">\n </dtml-in>\n
</dtml-in></dtml-if></dtml-let></dtml-if></dtml-in>\n <dtml-if expr="_.len(predicate_list) > 0">\n
<dtml-if expr="category_list">\n
INSERT INTO predicate_category VALUES \n INSERT INTO predicate_category VALUES \n
<dtml-in prefix="loop" expr="category_list">\n <dtml-in prefix="loop" expr="predicate_list">\n
<dtml-if sequence-start><dtml-else>,</dtml-if>(<dtml-sqlvar expr="loop_item[0]" type="int">, <dtml-sqlvar expr="loop_item[1]" type="int">, <dtml-sqlvar expr="loop_item[2]" type="int">, <dtml-sqlvar expr="loop_item[3]" type="int">)\n <dtml-if sequence-start><dtml-else>,</dtml-if>\n
</dtml-in>\n <dtml-if "predicate_property_dict[loop_item].has_key(\'membership_criterion_category_list\')">\n
</dtml-if>\n <dtml-let uid_list="portal_categories.getCategoryParentUidList(predicate_property_dict[loop_item][\'membership_criterion_category_list\'])">\n
</dtml-let> <dtml-if uid_list>\n
<dtml-in "uid_list">\n
(<dtml-sqlvar expr="uid[loop_item]" type="int">, <dtml-var "_[\'sequence-item\'][0]" >, <dtml-var "_[\'sequence-item\'][1]" >, <dtml-var "_[\'sequence-item\'][2]" >)\n
<dtml-if sequence-end><dtml-else>,</dtml-if>\n
</dtml-in> \n
<dtml-else>\n
(<dtml-sqlvar expr="uid[loop_item]" type="int">, 0, 0,1)\n
</dtml-if>\n
</dtml-let>\n
<dtml-else>\n
(<dtml-sqlvar expr="uid[loop_item]" type="int">, 0, 0,1)\n
</dtml-if>\n
</dtml-in>\n
</dtml-if>\n
</dtml-let>\n
]]></string> </value> ]]></string> </value>
</item> </item>
...@@ -149,9 +161,11 @@ INSERT INTO predicate_category VALUES \n ...@@ -149,9 +161,11 @@ INSERT INTO predicate_category VALUES \n
<value> <value>
<object> <object>
<klass> <klass>
<global name="SQL" module="Shared.DC.ZRDB.DA"/> <global name="__newobj__" module="copy_reg"/>
</klass> </klass>
<none/> <tuple>
<global name="SQL" module="Shared.DC.ZRDB.DA"/>
</tuple>
<state> <state>
<dictionary> <dictionary>
<item> <item>
...@@ -185,22 +199,37 @@ WHERE\n ...@@ -185,22 +199,37 @@ WHERE\n
uid=<dtml-sqlvar sequence-item type="int"><dtml-if sequence-end><dtml-else> OR </dtml-if>\n uid=<dtml-sqlvar sequence-item type="int"><dtml-if sequence-end><dtml-else> OR </dtml-if>\n
</dtml-in>\n </dtml-in>\n
;\n ;\n
\n
<dtml-var "\'\\0\'">\n <dtml-var "\'\\0\'">\n
<dtml-let category_list="[]">\n \n
<dtml-in prefix="loop" expr="_.range(_.len(uid))">\n <dtml-let predicate_list="[]">\n
<dtml-if expr="isPredicate[loop_item] and predicate_property_dict[loop_item].has_key(\'membership_criterion_category_list\')">\n <dtml-in prefix="loop" expr="_.range(_.len(uid))">\n
<dtml-let uid_list="portal_categories.getCategoryParentUidList(predicate_property_dict[loop_item][\'membership_criterion_category_list\'])">\n <dtml-if "isPredicate[loop_item]">\n
<dtml-if uid_list>\n <dtml-call expr="predicate_list.append(loop_item)">\n
<dtml-in prefix="uid" expr="uid_list">\n </dtml-if>\n
<dtml-call expr="category_list.append((uid[loop_item], uid_item[0], uid_item[1], uid_item[2]))">\n </dtml-in>\n
</dtml-in></dtml-if></dtml-let></dtml-if></dtml-in>\n <dtml-if expr="_.len(predicate_list) > 0">\n
<dtml-if expr="category_list">\n
INSERT INTO predicate_category VALUES \n INSERT INTO predicate_category VALUES \n
<dtml-in prefix="loop" expr="category_list">\n <dtml-in prefix="loop" expr="predicate_list">\n
<dtml-if sequence-start><dtml-else>,</dtml-if>(<dtml-sqlvar expr="loop_item[0]" type="int">, <dtml-sqlvar expr="loop_item[1]" type="int">, <dtml-sqlvar expr="loop_item[2]" type="int">, <dtml-sqlvar expr="loop_item[3]" type="int">)\n <dtml-if sequence-start><dtml-else>,</dtml-if>\n
</dtml-in>\n <dtml-if "predicate_property_dict[loop_item].has_key(\'membership_criterion_category_list\')">\n
</dtml-if>\n <dtml-let uid_list="portal_categories.getCategoryParentUidList(predicate_property_dict[loop_item][\'membership_criterion_category_list\'])">\n
</dtml-let> <dtml-if uid_list>\n
<dtml-in "uid_list">\n
(<dtml-sqlvar expr="uid[loop_item]" type="int">, <dtml-var "_[\'sequence-item\'][0]" >, <dtml-var "_[\'sequence-item\'][1]" >, <dtml-var "_[\'sequence-item\'][2]" >)\n
<dtml-if sequence-end><dtml-else>,</dtml-if>\n
</dtml-in> \n
<dtml-else>\n
(<dtml-sqlvar expr="uid[loop_item]" type="int">, 0, 0,1)\n
</dtml-if>\n
</dtml-let>\n
<dtml-else>\n
(<dtml-sqlvar expr="uid[loop_item]" type="int">, 0, 0,1)\n
</dtml-if>\n
</dtml-in>\n
</dtml-if>\n
</dtml-let>\n
]]></string> </value> ]]></string> </value>
</item> </item>
......
95 99
\ No newline at end of file \ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment