Persisting custom parameters in /query

30 views
Skip to first unread message

Florian Berger

unread,
Feb 7, 2024, 4:19:52 PMFeb 7
to trac...@googlegroups.com
I am working on a plugin which uses JavaScript to alter the display of the ticket /query result list
based on parameters in the URL, for example /query?status=accepted&myview=compact . The script will
detect the myview=compact in the URL and act accordingly.

The rationale is that that way, users can bookmark a combination of the filter parameters and the
view settings of my plugin, since it's all in the query string. Also, I do not have to alter the
generated HTML on Trac's server side.


When a user adjusts the parameters of a query to get a tailored list of tickets, the respective POST
request is apparently handled by QueryModule.process_request() im module ticket.query . In line 982
of the current version, a check for 'update' in req.args is performed, and if present, the redirect
req.redirect(query.get_href(req.href)) is triggered.

I would like my parameters to persist in the URL when the user changes filter settings and hits the
'update' button. According to my current understanding, I would have to hook into the above redirect
to basically achieve something like req.redirect(query.get_href(req.href) + '&myview=compact') in
QueryModule.process_request() .

I do not quite understand how I would achieve that using the plugin APIs. I have toyed a little with
IRequestFilter, but that did not get me anywhere.

Any hints, or sources achieving a similar effect, would be greatly appreciated.

Kind regards

Florian

Florian Berger

unread,
Feb 19, 2024, 5:48:40 AMFeb 19
to trac...@googlegroups.com
As there hasn't been any interest in this topic so far: I am willing to pay 1 hour of consulting by
an experienced Trac developer for getting this matter solved.

Clicking on "Update" after changing filter settings and being thrown back to list view is a
dealbreaker for my team.

You can contact me directly using the sender address of this mail.

Kind regards

Florian
Reply all
Reply to author
Forward
0 new messages