From af632818dc3e0aef19bb0f82784dd7f05f379573 Mon Sep 17 00:00:00 2001
From: Jean-Paul Smets <jp@nexedi.com>
Date: Sun, 23 May 2004 13:35:05 +0000
Subject: [PATCH] Intial loop detection

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@895 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5Type/Base.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/product/ERP5Type/Base.py b/product/ERP5Type/Base.py
index 39018c77ec..39cbcc08fd 100755
--- a/product/ERP5Type/Base.py
+++ b/product/ERP5Type/Base.py
@@ -199,6 +199,7 @@ class Base( CopyContainer, PortalContent, Base18, ActiveObject, ERP5PropertyMana
     #LOG("Get Acquired Property portal_type",0,str(portal_type))
     #super_list = self._getValueList(base_category, portal_type=portal_type) # We only do a single jump
     super_list = self._getAcquiredValueList(base_category, portal_type=portal_type) # We only do a single jump
+    super_list = filter(lambda o: o.getPhysicalPath() != self.getPhysicalPath(), super_list) # Make sure we do not create stupid loop here
     #LOG("Get Acquired Property super_list",0,str(super_list))
     #LOG("Get Acquired Property accessor_id",0,str(accessor_id))
     if len(super_list) > 0:
@@ -209,6 +210,7 @@ class Base( CopyContainer, PortalContent, Base18, ActiveObject, ERP5PropertyMana
       else:
         method = getattr(super, accessor_id)
         value = method() # We should add depends here XXXXXX
+                         # There is also a strong risk here of infinite loop
       if copy_value:
         if not hasattr(self, storage_id):
           # Copy the value if it does not already exist as an attribute of self
-- 
2.30.9