Florian Berger
unread,Feb 7, 2024, 4:19:52 PM2/7/24Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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