The page title from breadcrumb rules still require a page_title

Bug #429473 reported by Curtis Hovey
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Won't Fix
Low
Unassigned

Bug Description

While converting distribution +allpackages to UI 3.0. I had to add a page_title attribute to make to base-layout render the page, yet the page_title is not used anymore...page titles are reverse breadcrumbs.

Barry Warsaw (barry)
Changed in launchpad-foundations:
assignee: nobody → Barry Warsaw (barry)
importance: Low → High
milestone: none → 3.0
Revision history for this message
Barry Warsaw (barry) wrote :

This can/should only happen in very limited circumstances. The error is probably happening in tales.py:585 right? If so it means that one of these conditions is true:

* You've set override_title_breadcrumbs=True on your view class
* No +hierarchy adapter could be found for your context+request
* The +hierarchy adapter was found but its .display_breadcrumbs property returned False

If one of these things is true, it basically means it can't use breadcrumbs, either because they aren't available or you've told it to override the breadcrumbs. In that case, it first looks for view.page_title attribute and uses that if available. If that's not available, it uses the first of view.template.filename and view.index.filename to calculate a file name for pagetitles.py. If it finds none of these, it returns the DEFAULT_LAUNCHPAD_TITLE. If however, it finds a filename attribute but cannot find an entry in pagetitles.py for this filename (s/-/_/ of course), then it raises an assertion.

Can you provide more information, specifically why is it not finding a +hierarchy adapter, or why it is not finding a page title under the above search rules? Some odd views don't fit into these rules and you'll get the assertion. (An example is TeamInvitationView in person.py).

Changed in launchpad-foundations:
status: Triaged → Incomplete
Revision history for this message
Curtis Hovey (sinzui) wrote :

Yes. This is true. The I experienced this again when adding breadcrumbs to the TeamMembership views +member and +invitation.

Changed in launchpad-foundations:
status: Incomplete → Triaged
Curtis Hovey (sinzui)
Changed in launchpad-foundations:
milestone: 3.0 → none
tags: added: post-3-ui-cleanup tech-debt
Changed in launchpad-foundations:
assignee: Barry Warsaw (barry) → nobody
importance: High → Low
Jonathan Lange (jml)
affects: launchpad-foundations → launchpad-web
Revision history for this message
Curtis Hovey (sinzui) wrote :

New Note 41

While investigating spurious errors in a local test run, I saw many fmt:pagetitle errors. All the views in question used label. They did not have a page_title and were not registered in pagetitles.py. I looked at that pagetitle tales adapter and it *absolutely* requires page_title. Some pages work because LaunchpadFormView is providing a page_title from the label.

A simple solution to the current issue is to add a two lines to in the tales adapter to fall back to label when page_title is not found. then removing the many `page_title = label` and `label = page_title` hacks in our views.[1]

The Launchpad 3.0 header is still a root problem headings/labels. We sometimes want the label (used as the h2) to be different from the page_title (the last item in the breadcrumbs) because it is not clear what is being edited. The problem is most clear when you are looking a a deep pages where the context object is not the branded project/distro. For example:
    https://launchpad.net/ubuntu/maverick/+source/wsjt/+changelog

The heading cannot be "Change log" because seen under "Ubuntu", the user will pause as ask "what the ...?". We use a label to clarify the Change log is for a secondary context """Change logs for “wsjt” source package in Maverick""".

I conclude we still need a separate page_title and label attributes for many views. Those attributes could be renamed. It may be possible to drop the label (long heading) if the header was redesigned to show the immediate context before the action/view that the user is seeing. For example:

@ UBUNTU <primary context>
     “wsjt” source package <immediate context>
     Change log <view>
    Ubuntu >> Maverick (10.10) >> “wsjt” source package >> Change log

This suggestion is fatally flawed of course because it does not consider the Launchpad applications (bugs, code, ...)

[1] The errors cause by the play order of the tests were resolved by adding a rule to fall back to label, but I cannot explain why there was no error when the test was played by itself.

Huw Wilkins (huwshimi)
tags: added: ui
removed: post-3-ui-cleanup
Revision history for this message
Curtis Hovey (sinzui) wrote :

We do not want the page_title to be identical to the label i many cases. The label is intended to a sensible header. The page_title is a fragment that is appended to the context names in the bread crumbs.

Changed in launchpad:
status: Triaged → Won't Fix
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.