Ticket #7155 (closed Bug: fixed)

Opened 7 years ago

Last modified 5 years ago

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 Version:
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...

Change History

comment:1 Changed 6 years ago by laz

  • Status changed from new to closed
  • Resolution set to fixed

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

comment:2 Changed 6 years ago by laz

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

comment:3 Changed 5 years ago by hannosch

  • Milestone changed from 3.1.3 to 3.1.2

comment:4 Changed 5 years ago by hannosch

  • Component changed from Visual and templates to Templates/CSS
Note: See TracTickets for help on using tickets.