Permalink
Browse files

Fix issue #12279 by reverting commit 5cb41ff.

Also add a test that fails if commit 5cb41ff is present.
  • Loading branch information...
1 parent 200afa4 commit 0249ec866608e66b25aea2b918fb90fdf89d4ef8 @zupo zupo committed Nov 18, 2011
View
@@ -4,7 +4,8 @@ Changelog
2.2.3 (unreleased)
------------------
-- Nothing changed yet.
+- Reverted commit 5cb41ffea to fix #12279 and added a test for it.
+ [zupo, jcerjak]
2.2.2 (2011-10-17)
@@ -18,7 +19,7 @@ Changelog
- Avoid empty <ul> tag in navigation_recurse.pt if bottomLevel is set.
[gaudenzius]
-- Enable possibility to delete portlets with missing implementation
+- Enable possibility to delete portlets with missing implementation
[do3cc]
- Replace use of deprecated skin template prefs_group_details with
@@ -30,7 +31,7 @@ Changelog
------------------
- Imporove tests readability. Merged from branches/2.1
[gotcha]
-
+
- 'placeholder' attribute for the search portlet's field instead of the custom
JS handling of the same functionality.
[spliter]
@@ -41,7 +42,7 @@ Changelog
- Updated 'Advanced Search' link and form's action of the search portlet to
link to updated search results view at @@search.
[spliter]
-
+
2.1.5 - 2011-06-19
------------------
@@ -32,7 +32,7 @@
</a>
<ul tal:attributes="class python:'navTree navTreeLevel'+str(level)"
- tal:condition="python: len(children) > 0 and show_children and level &lt; bottomLevel">
+ tal:condition="python: len(children) > 0 and show_children">
<span tal:replace="structure python:view.recurse(children=children, level=level+1, bottomLevel=bottomLevel)" />
</ul>
</tal:level>
@@ -314,6 +314,21 @@ def testBottomLevelStopsAtFolder(self):
self.assertEqual(tree['children'][-1]['item'].getPath(), '/plone/folder2')
self.assertEqual(len(tree['children'][-1]['children']), 0)
+ def testBottomLevelZeroNoLimit(self):
+ """Test that bottomLevel=0 means no limit for bottomLevel."""
+
+ # first we set a high integer as bottomLevel to simulate "no limit"
+ view = self.renderer(self.portal.folder2, assignment=navigation.Assignment(bottomLevel=99, topLevel=0))
+ tree = view.getNavTree()
+ self.failUnless(tree)
+ self.assertEqual(tree['children'][-1]['children'][0]['item'].getPath(), '/plone/folder2/doc21')
+
+ # now set bottomLevel to 0 -> outcome should be the same
+ view = self.renderer(self.portal.folder2, assignment=navigation.Assignment(bottomLevel=0, topLevel=0))
+ tree = view.getNavTree()
+ self.failUnless(tree)
+ self.assertEqual(tree['children'][-1]['children'][0]['item'].getPath(), '/plone/folder2/doc21')
+
def testNoRootSet(self):
view = self.renderer(self.portal.folder2.file21, assignment=navigation.Assignment(root='', topLevel=0))
tree = view.getNavTree()

0 comments on commit 0249ec8

Please sign in to comment.