From 256597a928c7a8edc8e6e4ae46fef4ca4e1e114e Mon Sep 17 00:00:00 2001 From: helmutm Date: Sun, 8 Feb 2009 10:36:40 +0000 Subject: [PATCH] make access to parents more tolerant to allow breadcrumbs for views that don't have a content/root object git-svn-id: svn://svn.cy55.de/Zope3/src/cybertools/trunk@3216 fd906abe-77d9-0310-91a1-e0d9ade77398 --- integrator/browser/bscw.py | 2 +- integrator/bscw.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/integrator/browser/bscw.py b/integrator/browser/bscw.py index f1b27d8..9600b17 100644 --- a/integrator/browser/bscw.py +++ b/integrator/browser/bscw.py @@ -104,7 +104,7 @@ class ItemView(BaseView): @property def breadCrumbs(self): - parents = list(self.context.parents) + parents = [p for p in self.context.parents if p is not None] for p in reversed(parents): view = ItemView(p, self.request, self.parentView) yield dict(url=view.url, title=view.title) diff --git a/integrator/bscw.py b/integrator/bscw.py index 8a374e9..48ed18c 100644 --- a/integrator/bscw.py +++ b/integrator/bscw.py @@ -166,7 +166,8 @@ class BSCWProxyBase(object): return parentId = self.properties['location']['__id__'].lstrip('bs_') p = self.connection.getProxy(address=parentId, nested=False) - while parentId != self.connection.rootId: + while p is not None and parentId != self.connection.rootId: + #while parentId != self.connection.rootId: yield p parentId = p.properties['location']['__id__'].lstrip('bs_') p = self.connection.getProxy(address=parentId)