From 03c751d4f658acf07bb14847bca68b91636d8351 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Klaus=20W=C3=B6lfel?= <klaus@nexedi.com>
Date: Fri, 19 Sep 2014 18:52:17 +0200
Subject: [PATCH] erp5_promise: fix full_text table not created when installing
 bt5s

Call upgradeSite with CATALOG_UPDATED to enable automatic catalog update
behaviour
---
 .../portal_skins/erp5_promise/Alarm_checkPromiseBt5.xml     | 4 +++-
 .../portal_skins/erp5_promise/Alarm_installPromiseBt5.xml   | 6 ++++--
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/bt5/erp5_promise/SkinTemplateItem/portal_skins/erp5_promise/Alarm_checkPromiseBt5.xml b/bt5/erp5_promise/SkinTemplateItem/portal_skins/erp5_promise/Alarm_checkPromiseBt5.xml
index b5e25301c3..6ff2c7bfe6 100644
--- a/bt5/erp5_promise/SkinTemplateItem/portal_skins/erp5_promise/Alarm_checkPromiseBt5.xml
+++ b/bt5/erp5_promise/SkinTemplateItem/portal_skins/erp5_promise/Alarm_checkPromiseBt5.xml
@@ -52,6 +52,7 @@
             <key> <string>_body</string> </key>
             <value> <string>from Products.CMFActivity.ActiveResult import ActiveResult\n
 from Products.ERP5.Tool.TemplateTool import BusinessTemplateUnknownError\n
+from Products.ERP5.Tool.TemplateTool import CATALOG_UPDATABLE\n
 \n
 portal = context.getPortalObject()\n
 template_tool = portal.portal_templates\n
@@ -66,7 +67,8 @@ bt5_list = bt5.split()\n
 bt5_list.extend(template_tool.getInstalledBusinessTemplateTitleList())\n
 \n
 try:\n
-  message_list = template_tool.upgradeSite(bt5_list, dry_run=True)\n
+  message_list = template_tool.upgradeSite(bt5_list, dry_run=True,\n
+                                 update_catalog=CATALOG_UPDATABLE)\n
   severity = len(message_list)\n
 except BusinessTemplateUnknownError, error:\n
   severity = -1\n
diff --git a/bt5/erp5_promise/SkinTemplateItem/portal_skins/erp5_promise/Alarm_installPromiseBt5.xml b/bt5/erp5_promise/SkinTemplateItem/portal_skins/erp5_promise/Alarm_installPromiseBt5.xml
index 6cd0a199e4..4ae25f689c 100644
--- a/bt5/erp5_promise/SkinTemplateItem/portal_skins/erp5_promise/Alarm_installPromiseBt5.xml
+++ b/bt5/erp5_promise/SkinTemplateItem/portal_skins/erp5_promise/Alarm_installPromiseBt5.xml
@@ -50,7 +50,9 @@
         </item>
         <item>
             <key> <string>_body</string> </key>
-            <value> <string>portal = context.getPortalObject()\n
+            <value> <string>from Products.ERP5.Tool.TemplateTool import CATALOG_UPDATABLE\n
+\n
+portal = context.getPortalObject()\n
 bt5 = portal.getPromiseParameter(\'portal_templates\', \'expected_bt5\')\n
 \n
 if bt5 is None:\n
@@ -58,7 +60,7 @@ if bt5 is None:\n
 \n
 bt5_list = bt5.split()\n
 bt5_list.extend(portal.portal_templates.getInstalledBusinessTemplateTitleList())\n
-portal.portal_templates.upgradeSite(bt5_list)\n
+portal.portal_templates.upgradeSite(bt5_list, update_catalog=CATALOG_UPDATABLE)\n
 </string> </value>
         </item>
         <item>
-- 
2.30.9