From 38529a0b8dfda68598ffa89012a27042305e0df3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Aur=C3=A9lien=20Calonne?= <aurel@nexedi.com>
Date: Thu, 14 Oct 2010 12:19:25 +0000
Subject: [PATCH] copy properties which are guessed from data so that we do not
 loose information when cloning an event

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@39133 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../portal_skins/erp5_crm/Event_afterClone.xml     | 14 +++++++++-----
 bt5/erp5_crm/bt/revision                           |  2 +-
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Event_afterClone.xml b/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Event_afterClone.xml
index fd17fa66f9..8608109624 100644
--- a/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Event_afterClone.xml
+++ b/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Event_afterClone.xml
@@ -2,10 +2,7 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <tuple>
-        <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
-        <tuple/>
-      </tuple>
+      <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
     </pickle>
     <pickle>
       <dictionary>
@@ -53,7 +50,11 @@
         </item>
         <item>
             <key> <string>_body</string> </key>
-            <value> <string>context.setData(None)\n
+            <value> <string># We must copy these properties as they are retrieved from data\n
+title = context.getTitle()\n
+content = context.getTextContent()\n
+type = context.getContentType()\n
+context.edit(title=title, text_content=content, content_type=type, data=None)\n
 </string> </value>
         </item>
         <item>
@@ -92,6 +93,9 @@
                           <tuple>
                             <string>_getattr_</string>
                             <string>context</string>
+                            <string>title</string>
+                            <string>content</string>
+                            <string>type</string>
                             <string>None</string>
                           </tuple>
                         </value>
diff --git a/bt5/erp5_crm/bt/revision b/bt5/erp5_crm/bt/revision
index 5c84cf6fdb..560731b56b 100644
--- a/bt5/erp5_crm/bt/revision
+++ b/bt5/erp5_crm/bt/revision
@@ -1 +1 @@
-491
\ No newline at end of file
+490
\ No newline at end of file
-- 
2.30.9