From 34f0a5b3af9b99425546b58101ccfce7632c3055 Mon Sep 17 00:00:00 2001
From: Yoshinori Okuji <yo@nexedi.com>
Date: Tue, 30 Oct 2007 15:54:05 +0000
Subject: [PATCH] A workaround for workflow chains.

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

diff --git a/product/ERP5/Document/BusinessTemplate.py b/product/ERP5/Document/BusinessTemplate.py
index a68e06e5b6..20afed8741 100644
--- a/product/ERP5/Document/BusinessTemplate.py
+++ b/product/ERP5/Document/BusinessTemplate.py
@@ -1530,9 +1530,9 @@ class PortalTypeWorkflowChainTemplateItem(BaseTemplateItem):
             continue
         path_splitted = path.split('/', 1)
         # XXX: to avoid crashing when no portal_type
-        if len(path_splitted) < 2:
+        if len(path_splitted) < 1:
           continue
-        portal_type = path_splitted[1]
+        portal_type = path_splitted[-1]
         if chain_dict.has_key('chain_%s' % portal_type):
           old_chain_dict = chain_dict['chain_%s' % portal_type]
           # XXX we don't use the chain (Default) in erp5 so don't keep it
-- 
2.30.9