[Erp5-report] r26305 - in /erp5/trunk/bt5/erp5_ingestion: SkinTemplateItem/portal_skins/erp...

nobody at svn.erp5.org nobody at svn.erp5.org
Mon Apr 6 18:51:17 CEST 2009


Author: romain
Date: Mon Apr  6 18:51:16 2009
New Revision: 26305

URL: http://svn.erp5.org?rev=26305&view=rev
Log:
Prevent failing if content_type_registry is not found

Modified:
    erp5/trunk/bt5/erp5_ingestion/SkinTemplateItem/portal_skins/erp5_ingestion/ContributionTool_getCandidateTypeListByExtension.xml
    erp5/trunk/bt5/erp5_ingestion/bt/revision

Modified: erp5/trunk/bt5/erp5_ingestion/SkinTemplateItem/portal_skins/erp5_ingestion/ContributionTool_getCandidateTypeListByExtension.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_ingestion/SkinTemplateItem/portal_skins/erp5_ingestion/ContributionTool_getCandidateTypeListByExtension.xml?rev=26305&r1=26304&r2=26305&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_ingestion/SkinTemplateItem/portal_skins/erp5_ingestion/ContributionTool_getCandidateTypeListByExtension.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_ingestion/SkinTemplateItem/portal_skins/erp5_ingestion/ContributionTool_getCandidateTypeListByExtension.xml [utf8] Mon Apr  6 18:51:16 2009
@@ -57,9 +57,14 @@
   Find by give filename extension which portal_type is the right one.\n
   Use content_type_registry for that. \n
 """\n
+from Products.CMFCore.utils import getToolByName\n
 \n
-pt = context.content_type_registry.findTypeName(\'a.%s\' %ext, None, None)\n
-return (pt,)\n
+registry = getToolByName(context, \'content_type_registry\', None)\n
+if registry is None:\n
+  return (None, )\n
+else:\n
+  pt = registry.findTypeName(\'a.%s\' %ext, None, None)\n
+  return (pt,)\n
 </string> </value>
         </item>
         <item>
@@ -97,9 +102,12 @@
                         <value>
                           <tuple>
                             <string>ext</string>
-                            <string>_getattr_</string>
+                            <string>Products.CMFCore.utils</string>
+                            <string>getToolByName</string>
                             <string>context</string>
                             <string>None</string>
+                            <string>registry</string>
+                            <string>_getattr_</string>
                             <string>pt</string>
                           </tuple>
                         </value>

Modified: erp5/trunk/bt5/erp5_ingestion/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_ingestion/bt/revision?rev=26305&r1=26304&r2=26305&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_ingestion/bt/revision [utf8] (original)
+++ erp5/trunk/bt5/erp5_ingestion/bt/revision [utf8] Mon Apr  6 18:51:16 2009
@@ -1,1 +1,1 @@
-40
+43




More information about the Erp5-report mailing list