From 8eff622ed2db96dfd646a58df34da14ebb58d735 Mon Sep 17 00:00:00 2001
From: Ivan Tyagov <ivan@nexedi.com>
Date: Thu, 16 Sep 2010 10:05:26 +0000
Subject: [PATCH] Do care for syntax not to start with logical operator which
 should be used only for concatenating two sub search strings.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@38413 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../portal_skins/erp5_dms/Base_assembleSearchString.xml    | 7 ++++++-
 bt5/erp5_dms/bt/revision                                   | 2 +-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Base_assembleSearchString.xml b/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Base_assembleSearchString.xml
index ddfd9142ff..3ea0f41151 100644
--- a/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Base_assembleSearchString.xml
+++ b/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Base_assembleSearchString.xml
@@ -108,7 +108,11 @@ if portal_type_list:\n
     if \' \' in portal_type:\n
       portal_type = \'"%s"\' %portal_type\n
     portal_type_string_list.append(\'portal_type:%s\' %portal_type)\n
-  search_string += \' %s (%s)\' %(logical_operator, \' OR \'.join(portal_type_string_list))\n
+  portal_type_string = \'(%s)\' %\' OR \'.join(portal_type_string_list)\n
+  if search_string not in MARKER:\n
+    search_string += \' %s %s\' %(logical_operator, portal_type_string)\n
+  else:\n
+    search_string += portal_type_string\n
 \n
 # search by reference\n
 reference = kw.get(\'reference\', request.get(\'reference\', None))\n
@@ -214,6 +218,7 @@ return search_string\n
                             <string>str</string>
                             <string>portal_type_string_list</string>
                             <string>portal_type</string>
+                            <string>portal_type_string</string>
                             <string>reference</string>
                             <string>version</string>
                             <string>language</string>
diff --git a/bt5/erp5_dms/bt/revision b/bt5/erp5_dms/bt/revision
index 66dae0a039..ac2fca59ce 100644
--- a/bt5/erp5_dms/bt/revision
+++ b/bt5/erp5_dms/bt/revision
@@ -1 +1 @@
-1175
\ No newline at end of file
+1178
\ No newline at end of file
-- 
2.30.9