Commit 9f18a95b authored by Hanno Schlichting's avatar Hanno Schlichting

simplify getting the root

parent f78e908c
......@@ -18,6 +18,7 @@ $Id$
import zope.app.pagetemplate
from Acquisition import aq_base
from Acquisition import aq_get
from Acquisition import aq_parent
from AccessControl import getSecurityManager
from Products.PageTemplates.Expressions import SecureModuleImporter
......@@ -39,11 +40,9 @@ class ViewPageTemplateFile(zope.app.pagetemplate.ViewPageTemplateFile):
# get the root
obj = context['context']
root = None
while (getattr(aq_base(obj), 'getPhysicalRoot', None) is None
and aq_parent(obj) is not None):
obj = aq_parent(obj)
if getattr(obj, 'getPhysicalRoot', None) is not None:
root = obj.getPhysicalRoot()
meth = aq_get(obj, 'getPhysicalRoot', None)
if meth is not None:
root = meth()
context.update(here=context['context'],
# philiKON thinks container should be the view,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment