New bug and task page URL structure makes canonical_url ambiguous for bug-related objects

Bug #1899 reported by Brad Bollenbach
6
Affects Status Importance Assigned to Milestone
Launchpad itself
Invalid
Medium
Unassigned

Bug Description

The new bug and task page URL structure that I'm working on will make sure that, when viewing a bug, one is *always* in a context. Generally, I believe this to be a good thing, because in Real World use cases, it seems difficult to imagine a practical use case for viewing a bug outside of any context, and having context info allows us to tweak the UI for increased usability.

But, this raises the question: what is the "canonical_url" of bug-related objects? E.g. From bug-attachment-add.pt, the link to edit an attachment looks like:

    (<a tal:attributes="href attachment/fmt:url">edit</a>)

But the canonical_url for an attachment currently returns a URL like:

    /malone/bugs/1/attachments/2

In the new structure, that URL would have to be something like:

    /products/firefox/+bugs/1/attachments/1

i.e. the URL will change depending on your context. For now, I've worked around this in a manner similar to how these links are created in other portlets:

    (<a tal:attributes="href string:${bugtask_url}/attachments/${attachment/id}">edit</a>)

but the question of "what is the canonical_url of a bug-related object?" still needs to be answered.

Tags: lp-bugs
Brad Bollenbach (bradb)
Changed in malone:
assignee: nobody → bradb
status: New → Fixed
Changed in malone:
status: Fixed → Accepted
Revision history for this message
Diogo Matsubara (matsubara) wrote :

I think this is fixed. In doc/canonical_url_examples.txt you can see:
An IBug.
    >>> canonical_url(getUtility(IBugSet).get(1))
    u'http://bugs.launchpad.dev/bugs/1'

Changed in malone:
assignee: bradb → nobody
status: Confirmed → 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.