From f5f7e4f6f03f68868ab9129c14e8359e71ece34c Mon Sep 17 00:00:00 2001
From: Arnaud Fontaine <arnaud.fontaine@nexedi.com>
Date: Thu, 25 Nov 2010 02:52:38 +0000
Subject: [PATCH] Prevent infinite recursion when solving dependency on
 installation of Business Template portal types

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

diff --git a/product/ERP5/Document/BusinessTemplate.py b/product/ERP5/Document/BusinessTemplate.py
index 40c68b6867..70095a0fb3 100644
--- a/product/ERP5/Document/BusinessTemplate.py
+++ b/product/ERP5/Document/BusinessTemplate.py
@@ -1896,6 +1896,8 @@ class PortalTypeTemplateItem(ObjectTemplateItem):
         else:
           portal_type = klass.__name__
         depend = path_dict.get(portal_type)
+        # Prevent infinite recursion
+        assert depend != path
         cache[path] = score = depend and 1 + solveDependency(depend)[0] or 0
       return score, path
     PersistentMigrationMixin._no_migration += 1
-- 
2.30.9