Opened 9 years ago

Closed 9 years ago

#6757 closed bug (fixed)

Trac query: Component without submenu

Reported by: humdinger Owned by: nielx
Priority: normal Milestone:
Component: Website/Trac Version:
Keywords: Cc:
Blocked By: Blocking:
Has a Patch: no Platform: All

Description

In the Trac query, there used to be submenus for the component, like Add-Ons, Applications etc. Without those it's a whole lot of scrolling to get e.g. to Website/Trac...

Change History (9)

comment:1 by zooey, 9 years ago

Owner: changed from haiku-web to zooey
Status: newin-progress

Hm, I fear this might have been caused by my own bloody self daring to upgrade trac to 0.12.1 recently. I'm not sure, but this may or may not have overruled local extensions.

I will try to look into that later today.

comment:2 by nielx, 9 years ago

I was already aware of it, but being on vacation did not have the proper time to look into it.

The plugins are not overridden, so the chances are that perhaps the layout changed, which invalidated some of the jQuery selectors that perform the splitting of the component line. The overriding does work well on the 'New Ticket' page, so it is in that sense a change in the query.html template.

The revision history for that file shows the following change: http://trac.edgewall.org/changeset?reponame=&new=9958%40branches%2F0.12-stable%2Ftrac%2Fticket%2Ftemplates%2Fquery.html&old=9938%40branches%2F0.12-stable%2Ftrac%2Fticket%2Ftemplates%2Fquery.html

Furthermore, the bug does not happen when the component is already in the query. Only the code that adds it seems to fail.

So the bug is in the Javascript that hooks into those events.

I have to go and enjoy the holiday now. Cool if you are able to fix it, else I will try to later!

in reply to:  description ; comment:3 by zooey, 9 years ago

Replying to humdinger:

In the Trac query, there used to be submenus for the component, like Add-Ons, Applications etc. Without those it's a whole lot of scrolling to get e.g. to Website/Trac...

After having checked the current Trac and an older installation (0.12) I need to ask: are you sure that it used to be like that on the query page (and not just when modifying tickets)?

comment:4 by nielx, 9 years ago

To be honest, I am quite sure, though not certain. I cannot imagine not having tested it, though. At the same time, I thought about making a little checklist with tests for Trac upgrades, and I never had that one finished. Anyway, GTG now.

in reply to:  3 comment:5 by humdinger, 9 years ago

Replying to zooey:

are you sure that it used to be like that on the query page (and not just when modifying tickets)?

I'm pretty sure, but wouldn't bet your life on it...

comment:6 by zooey, 9 years ago

Owner: changed from zooey to nielx
Status: in-progressassigned

Reassigning to Niels, as I can't determine the cause and he's more familiar with the trac architecture.

comment:7 by nielx, 9 years ago

Status: assignedin-progress

The cause is that the name for the 'AND' selection list changed from add_filter to add_filter_0 (and increases with each new filter that is added).

A quick fix would be to have the convertQuery hook into 'add_filter_0', though it would (obviously) break when the query gets more complex. I have to think about this.

comment:8 by brecht, 9 years ago

I was also experiencing this problem while updating the HaikuPorts portlog plugin for Trac 0.13. It took me a very long time to find out what was wrong, but here it is.

The change in Trac 0.12.1 that causes this is that initializeFilters() is now called from within a jQuery(document).ready() as opposed to directly from the body (so, before the document is "ready"). As the componentselect script is referenced first in the HTML file, jQuery(document).ready(initialiseComponents) in that script is called before initializeFilters(). initializeFilters() and initialiseComponents() both set up handlers for the same event. The order in which the these handlers are called is the same as the order in which they have been set up, so componentselect's handler is called before the new filter has been added to the document!

In short, to fix this, you need to move the reference to componentselect.js to the end of the list of scripts in the HTML head (right before </head>).

comment:9 by nielx, 9 years ago

Resolution: fixed
Status: in-progressclosed

Thanks brecht!

It works now.

Note: See TracTickets for help on using tickets.