Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ticket11189 #3

Merged
merged 3 commits into from
Nov 21, 2011
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down
4 changes: 3 additions & 1 deletion plone/app/portlets/portlets/navigation_recurse.pt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
<li tal:define="show_children node/show_children;
children node/children;
item_url node/getURL;
item_remote_url node/getRemoteUrl;
use_remote_url node/useRemoteUrl | nothing;
item_icon nocall:node/item_icon;
item_type node/portal_type;
is_current node/currentItem;
Expand All @@ -24,7 +26,7 @@
item_class python:is_current and item_class + ' navTreeCurrentItem' or item_class;">


<a tal:attributes="href python:item_url;
<a tal:attributes="href python:use_remote_url and item_remote_url or item_url;
title node/Description;
class string:$item_class${li_class}${li_extr_class}${li_folder_class} $item_type_class">
<img tal:replace="structure item_icon/html_tag" />
Expand Down
18 changes: 16 additions & 2 deletions plone/app/portlets/tests/test_navigation_portlet.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down