[Erp5-report] r28566 - in /erp5/trunk/products/ERP5/bootstrap/erp5_core: SkinTemplateItem/p...

nobody at svn.erp5.org nobody at svn.erp5.org
Mon Aug 24 10:25:14 CEST 2009


Author: romain
Date: Mon Aug 24 10:25:13 2009
New Revision: 28566

URL: http://svn.erp5.org?rev=28566&view=rev
Log:
Only calls listFolderContents in the context of a Preference (to delete Template).

Modified:
    erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Folder_getDeleteObjectList.xml
    erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision

Modified: erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Folder_getDeleteObjectList.xml
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Folder_getDeleteObjectList.xml?rev=28566&r1=28565&r2=28566&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Folder_getDeleteObjectList.xml [utf8] (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Folder_getDeleteObjectList.xml [utf8] Mon Aug 24 10:25:13 2009
@@ -53,23 +53,19 @@
         </item>
         <item>
             <key> <string>_body</string> </key>
-            <value> <string encoding="cdata"><![CDATA[
-
-result = context.portal_catalog(**kw)\n
-\n
-if len(result)>0:\n
+            <value> <string># XXX This is a hack which allow to delete non indexed Template\n
+# Never call listFolderContents in a place where there could be million of\n
+# documents!\n
+if context.getPortalType() == \'Preference\':\n
+  result = []\n
+  uid_list = kw.get(\'uid\', [])\n
+  for i in context.listFolderContents():\n
+    if i.getUid() in uid_list:\n
+      result.append(i)\n
   return result\n
-\n
-result = []\n
-uid_list = kw.get(\'uid\', [])\n
-for i in context.listFolderContents():\n
-  if i.getUid() in uid_list:\n
-    result.append(i)\n
-\n
-return result\n
-
-
-]]></string> </value>
+else:\n
+  return context.portal_catalog(**kw)\n
+</string> </value>
         </item>
         <item>
             <key> <string>_code</string> </key>
@@ -106,14 +102,13 @@
                         <value>
                           <tuple>
                             <string>kw</string>
-                            <string>_apply_</string>
                             <string>_getattr_</string>
                             <string>context</string>
                             <string>result</string>
-                            <string>len</string>
                             <string>uid_list</string>
                             <string>_getiter_</string>
                             <string>i</string>
+                            <string>_apply_</string>
                           </tuple>
                         </value>
                     </item>

Modified: erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision?rev=28566&r1=28565&r2=28566&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision [utf8] (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision [utf8] Mon Aug 24 10:25:13 2009
@@ -1,1 +1,1 @@
-1283
+1284




More information about the Erp5-report mailing list