Menu system selects a tab that I didn't ask to be selected

Bug #1509 reported by Brad Bollenbach
4
Affects Status Importance Assigned to Milestone
Launchpad itself
Invalid
Medium
Steve Alexander

Bug Description

I have defined a menu for bug task pages like this:

class BugTaskPageMenu(MaloneApplicationMenu):
    """Malone application menu when viewing an IBugTask."""

    usedfor = IBugTask

    def context_bugs(self):
        context_title = self.context.contextname
        target = self._get_task_context_canonical_url() + "/+bugs"
        text = "%s Bugs" % context_title
        summary = "Bugs in %s" % context_title

        return Link(target, text, summary)

    def filebug(self):
        context_title = self.context.contextname
        filebug_url = self._get_task_context_canonical_url() + "/+filebug"
        target = filebug_url
        text = "Report a Bug"
        summary = "Report a Bug in %s" % context_title

        return Link(target, text, summary)

    def showreports(self):
        context_title = self.context.contextname
        bugs_url = self._get_task_context_canonical_url() + "/+bugs"
        # XXX: Brad Bollenbach, 2005-07-15: This URL is a workaround
        # until the following bug is fixed:
        #
        # https://launchpad.ubuntu.com/malone/bugs/881
        target = bugs_url + "/+advanced"
        text = "Show Reports"
        summary = "Show Reports for %s" % context_title

        showreports_link = Link(target, text, summary)
        showreports_link.selected = True

        return showreports_link

    def _get_task_context_canonical_url(self):
        return canonical_url(self.context.context)

When I view the URL:

    http://localhost:8086/products/firefox/+bugs/6

I expect to see only the "Show Reports" tab selected. Instead, I see *both* the "Mozilla Firefox Bugs" and the "Show Reports" tab selected.

Here is the +debug-menus output for the latter URL:

Request

    * http://localhost:8086/products/firefox/+bugs/6/+debug-menus

Facets

    * Overview
          o url: http://localhost:8086/products/firefox/
          o target:
          o selected: False
          o linked: True
          o text: Overview
          o summary: General information about Mozilla Firefox
    * Bugs
          o url: http://localhost:8086/products/firefox/+bugs
          o target: +bugs
          o selected: True
          o linked: True
          o text: Bugs
          o summary: Bugs reported about Mozilla Firefox
    * Translations
          o url: http://localhost:8086/products/firefox/+translations
          o target: +translations
          o selected: False
          o linked: True
          o text: Translations
          o summary: Translations of Mozilla Firefox in Rosetta

Menus

    * Mozilla Firefox Bugs
          o url: http://localhost:8086/products/firefox/+bugs
          o target: http://localhost:8086/products/firefox/+bugs
          o selected: True
          o linked: True
          o text: Mozilla Firefox Bugs
          o summary: Bugs in Mozilla Firefox
    * Report a Bug
          o url: http://localhost:8086/products/firefox/+filebug
          o target: http://localhost:8086/products/firefox/+filebug
          o selected: False
          o linked: True
          o text: Report a Bug
          o summary: Report a Bug in Mozilla Firefox
    * Show Reports
          o url: http://localhost:8086/products/firefox/+bugs/+advanced
          o target: http://localhost:8086/products/firefox/+bugs/+advanced
          o selected: True
          o linked: True
          o text: Show Reports
          o summary: Show Reports for Mozilla Firefox

Brad Bollenbach (bradb)
Changed in launchpad:
assignee: nobody → stevea
status: New → Accepted
Brad Bollenbach (bradb)
description: updated
Revision history for this message
Steve Alexander (stevea) wrote :

The concept of "selected menu" has been removed from application menus. It is only present in facet menus. Closing this bug.

Changed in launchpad:
status: Accepted → Rejected
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.