[Erp5-report] r18937 - /erp5/trunk/products/ERP5Form/ProxyField.py

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Jan 31 10:36:31 CET 2008


Author: yusei
Date: Thu Jan 31 10:36:31 2008
New Revision: 18937

URL: http://svn.erp5.org?rev=18937&view=rev
Log:
Prevent infinite loop when proxy field was broken.

Modified:
    erp5/trunk/products/ERP5Form/ProxyField.py

Modified: erp5/trunk/products/ERP5Form/ProxyField.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Form/ProxyField.py?rev=18937&r1=18936&r2=18937&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Form/ProxyField.py (original)
+++ erp5/trunk/products/ERP5Form/ProxyField.py Thu Jan 31 10:36:31 2008
@@ -376,10 +376,16 @@
     This result must not be a ProxyField.
     """
     field = self
+    chain = []
     while True:
       template_field = field.getTemplateField()
       if template_field.__class__ != ProxyField:
         break
+      if aq_base(template_field) in chain:
+        LOG('ProxyField', WARNING, 'Infinite loop detected in %s.' %
+            '/'.join(self.getPhysicalPath()))
+        return
+      chain.append(aq_base(template_field))
       field = template_field
     return template_field
 




More information about the Erp5-report mailing list