Commit 92e13bbb authored by Romain Courteaud's avatar Romain Courteaud

getWebSectionValueList should return nothing if no web section is visible.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@26334 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent dc584473
......@@ -220,26 +220,30 @@ class WebSite(WebSection):
id='WebSite._getWebSectionUidList',
cache_factory='erp5_content_medium')
section_list = self.portal_domains.searchPredicateList(document,
portal_type='Web Section',
uid=_getWebSectionUidList(self))
web_section_uid_list = _getWebSectionUidList(self)
if web_section_uid_list:
section_list = self.portal_domains.searchPredicateList(document,
portal_type='Web Section',
uid=web_section_uid_list)
section_dict = {}
section_dict = {}
for section in section_list:
section_dict[section.getPhysicalPath()] = section
for section in section_list:
section_dict[section.getPhysicalPath()] = section
# Eliminate path
for section in section_list:
path = section.getPhysicalPath()
for i in range(0, len(path)-1):
sub_path = path[0:i]
if section_dict.has_key(sub_path):
del section_dict[sub_path]
# Eliminate path
for section in section_list:
path = section.getPhysicalPath()
for i in range(0, len(path)-1):
sub_path = path[0:i]
if section_dict.has_key(sub_path):
del section_dict[sub_path]
section_list = section_dict.values()
section_list = section_dict.values()
# Sort by Index
section_list.sort(key=lambda x: x.getIntIndex())
# Sort by Index
section_list.sort(key=lambda x: x.getIntIndex())
return section_list
return section_list
else:
return []
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