From 57c438c6671b122295f41cfdd5b2f8dad5a67c79 Mon Sep 17 00:00:00 2001
From: Yusei Tahara <yusei@nexedi.com>
Date: Tue, 8 Jun 2010 12:51:02 +0000
Subject: [PATCH] Allow 0(zero) value. This is needed for "non-left join"
 version of predicate category search.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@36095 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/CMFCategory/CategoryTool.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/product/CMFCategory/CategoryTool.py b/product/CMFCategory/CategoryTool.py
index 2c9fd72d8e..29d2461543 100644
--- a/product/CMFCategory/CategoryTool.py
+++ b/product/CMFCategory/CategoryTool.py
@@ -1535,8 +1535,8 @@ class CategoryTool( UniqueObject, Folder, Base ):
               (category_uid_name, renderUIDWithOperator(base_category_uid)))
           else:
             # In any other case, allow it.
-            where_expression_list.append('(%s IS NULL OR %s IN (%s))' % \
-              (category_uid_name, category_uid_name,
+            where_expression_list.append('(%s IS NULL OR %s = 0 OR %s IN (%s))' % \
+              (category_uid_name, category_uid_name, category_uid_name,
                ', '.join([renderUIDValue(x) for x in category_uid_list])))
         result['from_expression'] = {catalog_table_name:
           ('\nLEFT JOIN `%s` AS ' % (query_table, )).join(left_join_list)}
-- 
2.30.9