From f9824967f3f873043d4a0e1555230908874e2db4 Mon Sep 17 00:00:00 2001 From: Fulvio Casali Date: Fri, 18 Nov 2011 19:37:53 -0800 Subject: [PATCH 1/3] Fix for the nav portlet scenario of ticket#11189 Use the remote URL for the href of Link objects if the user is not the author. Depends on Products.CMFPlone --- plone/app/portlets/portlets/navigation_recurse.pt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plone/app/portlets/portlets/navigation_recurse.pt b/plone/app/portlets/portlets/navigation_recurse.pt index 55710fa1..db6e58ea 100644 --- a/plone/app/portlets/portlets/navigation_recurse.pt +++ b/plone/app/portlets/portlets/navigation_recurse.pt @@ -8,6 +8,8 @@
  • - From 1c081b50008d5bac569bb67d95b169f14e4cfaa4 Mon Sep 17 00:00:00 2001 From: Fulvio Casali Date: Sat, 19 Nov 2011 13:17:15 -0800 Subject: [PATCH 2/3] Added tests for fix to nav portlet scenario of ticket#11189. --- .../portlets/tests/test_navigation_portlet.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/plone/app/portlets/tests/test_navigation_portlet.py b/plone/app/portlets/tests/test_navigation_portlet.py index 3dd6a4df..002e3d20 100644 --- a/plone/app/portlets/tests/test_navigation_portlet.py +++ b/plone/app/portlets/tests/test_navigation_portlet.py @@ -212,9 +212,23 @@ def testCreateNavTreeWithLink(self): tree = view.getNavTree() for child in tree['children']: if child['portal_type'] != 'Link': - self.failIf(child['item'].getRemoteUrl) + self.failIf(child['getRemoteUrl']) if child['Title'] == 'link1': - self.failUnlessEqual(child['item'].getRemoteUrl, 'http://plone.org') + self.failUnlessEqual(child['getRemoteUrl'], 'http://plone.org') + # as Creator, link1 should not use the remote Url + self.failIf(child['useRemoteUrl']) + + self.portal.link1.setCreators(['some_other_user']) + self.portal.link1.reindexObject() + view = self.renderer(self.portal) + tree = view.getNavTree() + for child in tree['children']: + if child['portal_type'] != 'Link': + self.failIf(child['getRemoteUrl']) + if child['Title'] == 'link1': + self.failUnlessEqual(child['getRemoteUrl'], 'http://plone.org') + # as non-Creator user, link1 should use the remote Url + self.failUnless(child['useRemoteUrl']) def testNonStructuralFolderHidesChildren(self): # Make sure NonStructuralFolders act as if parentMetaTypesNotToQuery From d53b17e713002dbc15b817e98f6127fb7284d2b1 Mon Sep 17 00:00:00 2001 From: Fulvio Casali Date: Sat, 19 Nov 2011 13:46:13 -0800 Subject: [PATCH 3/3] Added changelog entry for ticket#11189. --- CHANGES.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGES.txt b/CHANGES.txt index 44605be9..0b17146c 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -4,6 +4,10 @@ Changelog 2.2.3 (unreleased) ------------------ +- Fixed the two high priority scenarios (global sections viewlet and nav + portlet) of http://dev.plone.org/ticket/11189. + [fulv] + - Reverted commit 5cb41ffea to fix #12279 and added a test for it. [zupo, jcerjak]