[Erp5-report] r9972 - /erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal...

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Sep 15 11:59:23 CEST 2006


Author: vincent
Date: Fri Sep 15 11:59:22 2006
New Revision: 9972

URL: http://svn.erp5.org?rev=9972&view=rev
Log:
Don't fail when the context has no getPropertyMap method (like ERP5Site).

Modified:
    erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getFieldDescription.xml

Modified: erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getFieldDescription.xml
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getFieldDescription.xml?rev=9972&r1=9971&r2=9972&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getFieldDescription.xml (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getFieldDescription.xml Fri Sep 15 11:59:22 2006
@@ -73,7 +73,10 @@
 if desc in (\'\', None):\n
   id = field.getId().split(\'_\', 1)\n
   if id[0] == \'my\':\n
-    properties = context.propertyMap()\n
+    try:\n
+      properties = context.propertyMap()\n
+    except AttributeError: # If context has no propertyMap, give up\n
+      properties = []\n
     for property in properties:\n
       if id[1] == property[\'id\']:\n
         return property.get(\'description\', \'\')\n
@@ -135,6 +138,7 @@
                             <string>_getitem_</string>
                             <string>context</string>
                             <string>properties</string>
+                            <string>AttributeError</string>
                             <string>_getiter_</string>
                             <string>property</string>
                           </tuple>




More information about the Erp5-report mailing list