Ticket #7155 (closed Bug: fixed)
selectedTabs.py: portal_tab linked to external url will show as selected on home page
| Reported by: | jessesnyder | Owned by: | limi |
|---|---|---|---|
| Priority: | minor | Milestone: | 3.1.2 |
| Component: | Templates/CSS | Keywords: | |
| Cc: |
Description
selectedTabs.py seems to assume that all action url's are internal. If you add an action with an external url shorter than plone_url, this action may be returned rather than default_url when you are on the home page or at the site root. The result is that this external url tab will show as 'selected'. It seems like it shouldn't behave this way; an external link portal_tab should never be 'selected'.
The following seems to fix, at least in my environment:
for action in portal_tabs:
# start patch
if not action['url'].startswith(plone_url):
continue
# end patch
action_path = action['url'][len(plone_url):]
if not action_path.startswith('/'):
etc...
Note: See
TracTickets for help on using
tickets.

(In [20791]) Fix currently selected portal_tab when some actions are linking to external urls This fixes #7155