Skip to content

Commit

Permalink
[fc] Repository: plone.app.layout
Browse files Browse the repository at this point in the history
Branch: refs/heads/master
Date: 2016-12-29T21:09:54Z
Author: Daniel Jowett (djowett) <daniel@jowettenterprises.com>
Commit: plone/plone.app.layout@dc5bf98

Fix sitemap.xml.gz for plone.app.multilingual (&gt;= 2.x) but breaks it for LinguaPlone and PAM 1.x

If this is a problem then please see bedbfeb67 on 2.5.x branch for how to maintain compatibility with these products.

Files changed:
M CHANGES.rst
M plone/app/layout/sitemap/sitemap.py
Repository: plone.app.layout
Branch: refs/heads/master
Date: 2016-12-30T11:01:22+01:00
Author: Jens W. Klein (jensens) <jk@kleinundpartner.at>
Commit: plone/plone.app.layout@b219090

Merge pull request #110 from plone/master_fix_issue_91

Fix sitemap.xml.gz for plone.app.multilingual (&gt;= 2.x)

Files changed:
M CHANGES.rst
M plone/app/layout/sitemap/sitemap.py
  • Loading branch information
jensens committed Dec 30, 2016
1 parent 23eb660 commit 2a076d0
Showing 1 changed file with 80 additions and 106 deletions.
186 changes: 80 additions & 106 deletions last_commit.txt
Original file line number Diff line number Diff line change
@@ -1,140 +1,114 @@
Repository: plone.app.portlets
Repository: plone.app.layout


Branch: refs/heads/master
Date: 2016-12-27T15:31:36+02:00
Author: Asko Soukka (datakurre) <asko.soukka@iki.fi>
Commit: https://github.com/plone/plone.app.portlets/commit/b770135d2a92320a4a5b28d2cb993475360da213
Date: 2016-12-29T21:09:54Z
Author: Daniel Jowett (djowett) <daniel@jowettenterprises.com>
Commit: https://github.com/plone/plone.app.layout/commit/dc5bf988ffbc7309a99d4e10e90911cf4777d576

Fix issue where navigation portlet ignored bottomLevel == 0
Fix sitemap.xml.gz for plone.app.multilingual (&gt;= 2.x) but breaks it for LinguaPlone and PAM 1.x

If this is a problem then please see bedbfeb67 on 2.5.x branch for how to maintain compatibility with these products.

Files changed:
M CHANGES.rst
M plone/app/portlets/portlets/navigation_recurse.pt
M plone/app/portlets/tests/test_navigation_portlet.py
M plone/app/layout/sitemap/sitemap.py

diff --git a/CHANGES.rst b/CHANGES.rst
index 419a3aa..400b407 100644
index e2f7675..3a44eb5 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -15,6 +15,10 @@ New features:
@@ -6,7 +6,11 @@ Changelog

Breaking changes:

Bug fixes:
-- *add item here*
+- Fix sitemap.xml.gz for plone.app.multilingual (>= 2.x) but breaks it for
+ LinguaPlone and plone.app.multilingual 1.x
+ If this is a problem then please see bedbfeb67 on 2.5.x branch for how to
+ maintain compatibility with these products.
+ [djowett]

+- Fix regression where navigation portlet ignored unlimited setting for
+ *Navigation tree depth* setting
+ [datakurre]
+
- Make sure, that ``utils.assignment_mapping_from_key`` traverses only to non-unicode paths.
OFS.traversable doesn't accept unicode paths.
[thet]
diff --git a/plone/app/portlets/portlets/navigation_recurse.pt b/plone/app/portlets/portlets/navigation_recurse.pt
index 1768ebb..98fd238 100644
--- a/plone/app/portlets/portlets/navigation_recurse.pt
+++ b/plone/app/portlets/portlets/navigation_recurse.pt
@@ -38,7 +38,7 @@
New features:

<tal:children condition="children">
<ul tal:attributes="class string:navTree navTreeLevel${level}"
- tal:condition="python: children and show_children and bottomLevel and level < bottomLevel">
+ tal:condition="python: children and show_children and bottomLevel and level < bottomLevel or bottomLevel == 0">
<span tal:replace="structure python:view.recurse(children=children, level=level+1, bottomLevel=bottomLevel)" />
</ul>
</tal:children>
diff --git a/plone/app/portlets/tests/test_navigation_portlet.py b/plone/app/portlets/tests/test_navigation_portlet.py
index 5b63c56..ba27956 100644
--- a/plone/app/portlets/tests/test_navigation_portlet.py
+++ b/plone/app/portlets/tests/test_navigation_portlet.py
@@ -328,6 +328,19 @@ def testBottomLevelZeroNoLimit(self):
self.assertTrue(tree)
self.assertEqual(tree['children'][-1]['children'][0]['item'].getPath(), '/plone/folder2/doc21')
diff --git a/plone/app/layout/sitemap/sitemap.py b/plone/app/layout/sitemap/sitemap.py
index d8bfd60..7a21b90 100644
--- a/plone/app/layout/sitemap/sitemap.py
+++ b/plone/app/layout/sitemap/sitemap.py
@@ -54,7 +54,7 @@ def objects(self):

+ def testBottomLevelZeroNoLimitRendering(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))
+ a = view.render()
+
+ # now set bottomLevel to 0 -> outcome should be the same
+ view = self.renderer(self.portal.folder2, assignment=navigation.Assignment(bottomLevel=0, topLevel=0))
+ b = view.render()
+
+ self.assertEqual(a, b)
+
def testNavRootWithUnicodeNavigationRoot(self):
self.portal.folder2.invokeFactory('Folder', 'folder21')
self.portal.folder2.folder21.invokeFactory('Document', 'doc211')


Repository: plone.app.portlets
query['is_default_page'] = True
default_page_modified = OOBTree()
- for item in catalog.searchResults(query, Language='all'):
+ for item in catalog.searchResults(query):
key = item.getURL().rsplit('/', 1)[0]
value = (item.modified.micros(), item.modified.ISO8601())
default_page_modified[key] = value
@@ -78,7 +78,7 @@ def objects(self):
}
query['is_default_page'] = False
- for item in catalog.searchResults(query, Language='all'):
+ for item in catalog.searchResults(query):
loc = item.getURL()
date = item.modified
# Comparison must be on GMT value


Repository: plone.app.layout


Branch: refs/heads/master
Date: 2016-12-29T16:59:21+01:00
Date: 2016-12-30T11:01:22+01:00
Author: Jens W. Klein (jensens) <jk@kleinundpartner.at>
Commit: https://github.com/plone/plone.app.portlets/commit/647d615e089b73a8788f9ef1c6b994c2eb45ea70
Commit: https://github.com/plone/plone.app.layout/commit/b219090b9454200832dece9b5a2324f373f081cf

Merge pull request #94 from plone/datakurre-fix-bottomLevel
Merge pull request #110 from plone/master_fix_issue_91

Fix issue where navigation portlet ignored bottomLevel == 0
Fix sitemap.xml.gz for plone.app.multilingual (&gt;= 2.x)

Files changed:
M CHANGES.rst
M plone/app/portlets/portlets/navigation_recurse.pt
M plone/app/portlets/tests/test_navigation_portlet.py
M plone/app/layout/sitemap/sitemap.py

diff --git a/CHANGES.rst b/CHANGES.rst
index 419a3aa..400b407 100644
index e2f7675..3a44eb5 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -15,6 +15,10 @@ New features:
@@ -6,7 +6,11 @@ Changelog

Breaking changes:

-- *add item here*
+- Fix sitemap.xml.gz for plone.app.multilingual (>= 2.x) but breaks it for
+ LinguaPlone and plone.app.multilingual 1.x
+ If this is a problem then please see bedbfeb67 on 2.5.x branch for how to
+ maintain compatibility with these products.
+ [djowett]

Bug fixes:
New features:

+- Fix regression where navigation portlet ignored unlimited setting for
+ *Navigation tree depth* setting
+ [datakurre]
+
- Make sure, that ``utils.assignment_mapping_from_key`` traverses only to non-unicode paths.
OFS.traversable doesn't accept unicode paths.
[thet]
diff --git a/plone/app/portlets/portlets/navigation_recurse.pt b/plone/app/portlets/portlets/navigation_recurse.pt
index 1768ebb..98fd238 100644
--- a/plone/app/portlets/portlets/navigation_recurse.pt
+++ b/plone/app/portlets/portlets/navigation_recurse.pt
@@ -38,7 +38,7 @@
diff --git a/plone/app/layout/sitemap/sitemap.py b/plone/app/layout/sitemap/sitemap.py
index d8bfd60..7a21b90 100644
--- a/plone/app/layout/sitemap/sitemap.py
+++ b/plone/app/layout/sitemap/sitemap.py
@@ -54,7 +54,7 @@ def objects(self):

<tal:children condition="children">
<ul tal:attributes="class string:navTree navTreeLevel${level}"
- tal:condition="python: children and show_children and bottomLevel and level < bottomLevel">
+ tal:condition="python: children and show_children and bottomLevel and level < bottomLevel or bottomLevel == 0">
<span tal:replace="structure python:view.recurse(children=children, level=level+1, bottomLevel=bottomLevel)" />
</ul>
</tal:children>
diff --git a/plone/app/portlets/tests/test_navigation_portlet.py b/plone/app/portlets/tests/test_navigation_portlet.py
index 5b63c56..ba27956 100644
--- a/plone/app/portlets/tests/test_navigation_portlet.py
+++ b/plone/app/portlets/tests/test_navigation_portlet.py
@@ -328,6 +328,19 @@ def testBottomLevelZeroNoLimit(self):
self.assertTrue(tree)
self.assertEqual(tree['children'][-1]['children'][0]['item'].getPath(), '/plone/folder2/doc21')
query['is_default_page'] = True
default_page_modified = OOBTree()
- for item in catalog.searchResults(query, Language='all'):
+ for item in catalog.searchResults(query):
key = item.getURL().rsplit('/', 1)[0]
value = (item.modified.micros(), item.modified.ISO8601())
default_page_modified[key] = value
@@ -78,7 +78,7 @@ def objects(self):
}

+ def testBottomLevelZeroNoLimitRendering(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))
+ a = view.render()
+
+ # now set bottomLevel to 0 -> outcome should be the same
+ view = self.renderer(self.portal.folder2, assignment=navigation.Assignment(bottomLevel=0, topLevel=0))
+ b = view.render()
+
+ self.assertEqual(a, b)
+
def testNavRootWithUnicodeNavigationRoot(self):
self.portal.folder2.invokeFactory('Folder', 'folder21')
self.portal.folder2.folder21.invokeFactory('Document', 'doc211')
query['is_default_page'] = False
- for item in catalog.searchResults(query, Language='all'):
+ for item in catalog.searchResults(query):
loc = item.getURL()
date = item.modified
# Comparison must be on GMT value


0 comments on commit 2a076d0

Please sign in to comment.