Define a way to request a rootsite with fmt:url

Bug #84022 reported by Francis J. Lacoste
4
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
Low
Unassigned

Bug Description

On the frontpage of distrorelease, I want to generate a link to the +addticket view of the distribution object. That view should be accessed using the 'Answers' rootsite. string:${context/distribution/fmt:url}/+addticket renders the link as https://lauchpad.net/ubuntu/+addticket

Maybe the requested rootsite could be passed as an additional path argument?

Related branches

Revision history for this message
James Henstridge (jamesh) wrote :

Related to this, it would be nice to be able to pass in a rootsite to canonical_url().

One question is what behaviour we should have if the object in question has a rootsite specified? The three options I can think of are:

1. ignore the passed rootsite and use the object's rootsite
2. ignore the object's rootsite and use the passed rootsite
3. raise an exception

(2) could be bad if we have different traversal for different domains, since it might generate a bad URL. So I'd lean towards (3).

Revision history for this message
Francis J. Lacoste (flacoste) wrote :

canonical_url() now accept a rootsite argument (this is a relatively recent addition).

Its current bejaviour is 2. (ignore the object's rootsite and use the passed rootsite).

Revision history for this message
Curtis Hovey (sinzui) wrote :

PersonFormatterAPI supports fmt:link:<rootsite>. The magic is done in traverse() The magic could be pushed down to ObjectFormatterAPI

Revision history for this message
Curtis Hovey (sinzui) wrote :

I need to implement this to fix another bug.

Changed in launchpad-foundations:
assignee: nobody → Curtis Hovey (sinzui)
importance: Undecided → Low
milestone: none → 2.2.8
status: New → In Progress
Revision history for this message
Curtis Hovey (sinzui) wrote :

Fixed in launchpad devel r9115.

Changed in launchpad-foundations:
status: In Progress → Fix Committed
visibility: private → public
Revision history for this message
Curtis Hovey (sinzui) wrote : Bug 84022 Fix released

Fixed released in launchpad-project 2.2.8.

Changed in launchpad-foundations:
status: Fix Committed → Fix Released
Curtis Hovey (sinzui)
Changed in launchpad:
assignee: Curtis Hovey (sinzui) → nobody
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.