From: Wichert A. <svn...@pl...> - 2008-01-04 10:23:39
|
Author: wichert Date: Fri Jan 4 10:23:42 2008 New Revision: 18836 Modified: plone.app.portlets/trunk/docs/HISTORY.txt plone.app.portlets/trunk/plone/app/portlets/portlets/navigation.py Log: Correct getRootPath to not add a trailing / to paths if there are no context subelements. This was breaking webcouturier.dropdownmenu in situations where one of the sections was a navigation root. Modified: plone.app.portlets/trunk/docs/HISTORY.txt ============================================================================== --- plone.app.portlets/trunk/docs/HISTORY.txt (original) +++ plone.app.portlets/trunk/docs/HISTORY.txt Fri Jan 4 10:23:42 2008 @@ -2,6 +2,14 @@ (name of developer listed in brackets) + +plone.app.portlets UNRELEASED + + - Correct getRootPath to not add a trailing / to paths if there + are no context subelements. This was breaking webcouturier.dropdownmenu + in situations where one of the sections was a navigation root. + [wichert] + plone.app.portlets 1.0.5 - Made absolute_url() work properly on the custom adding views. This is Modified: plone.app.portlets/trunk/plone/app/portlets/portlets/navigation.py ============================================================================== --- plone.app.portlets/trunk/plone/app/portlets/portlets/navigation.py (original) +++ plone.app.portlets/trunk/plone/app/portlets/portlets/navigation.py Fri Jan 4 10:23:42 2008 @@ -370,9 +370,11 @@ contextPath = '/'.join(context.getPhysicalPath()) if not contextPath.startswith(rootPath): return None - contextSubPathElements = contextPath[len(rootPath)+1:].split('/') - if len(contextSubPathElements) < topLevel: - return None - rootPath = rootPath + '/' + '/'.join(contextSubPathElements[:topLevel]) + contextSubPathElements = contextPath[len(rootPath)+1:] + if contextSubPathElements: + contextSubPathElements = contextSubPathElements.split('/') + if len(contextSubPathElements) < topLevel: + return None + rootPath = rootPath + '/' + '/'.join(contextSubPathElements[:topLeve]) return rootPath |