Commit 87f85c35 authored by Bartek Górny's avatar Bartek Górny

Moved getWebSectionValue to Base until issue related to acquisition is understood

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@11092 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent b53e7e7a
...@@ -62,10 +62,15 @@ class WebSection(Domain): ...@@ -62,10 +62,15 @@ class WebSection(Domain):
) )
# Draft - this is being worked on # Draft - this is being worked on
security.declareProtected(Permissions.AccessContentsInformation, 'getWebSectionValue') # Due to some issues in acquisition, the implementation of getWebSectionValue
def getWebSectionValue(self): # through acquisition by containment does not work for URLs
""" # such as web_site_module/a/b/c/web_page_module/d
Returns the current web section (ie. self) though containment acquisition # getWebSectionValue will return web_site_module/a/b instead
""" # of web_site_module/a/b/c
return self #security.declareProtected(Permissions.AccessContentsInformation, 'getWebSectionValue')
#def getWebSectionValue(self):
#"""
#Returns the current web section (ie. self) though containment acquisition
#"""
#return self
...@@ -2706,6 +2706,20 @@ class Base( CopyContainer, ...@@ -2706,6 +2706,20 @@ class Base( CopyContainer,
dochelper.setDynamicPropertyList(dynamic_property_list) dochelper.setDynamicPropertyList(dynamic_property_list)
return dochelper return dochelper
security.declareProtected(Permissions.AccessContentsInformation, 'getWebSectionValue')
def getWebSectionValue(self):
"""
Returns the current web section (ie. self) though parent acquisition
This method has been moved temporatily from WebSection to Base
until we understand the bug / issue in acquisition
"""
section = self
portal = self.getPortalObject()
while section.getPortalType() not in ('Web Site', 'Web Section', ) and\
section is not portal:
section = section.aq_parent
return section
InitializeClass(Base) InitializeClass(Base)
class TempBase(Base): class TempBase(Base):
......
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