Thomas Moschny
2017-02-07 10:39:00 UTC
Hi,
we have some (internal) plugin that modifies ticket field properties
on the fly. It hooks into /ticket and /query requests via
IRequestFilter.post_process_request() and modifies data['fields'].
This worked fine for older Trac versions. But newer Trac seems not to
use 'data' in /query requests anymore. Instead the ticket field
properties are passed in the global JS 'properties' variable (via
add_script_data()).
Now, in my plugin's post_process_request hook, I can also call
add_script_data(). Unfortunately, updating 'properties' doesn't really
work that way, as one can only replace whole keys.
One easy way would be to access req.chrome['script_data'] directly,
but that feels a bit like cheating (working around the API).
Another (more sledgehammery) way would be to add a JS snippet that
modifies 'properties'.
Is there some clean way in between?
Thanks,
Thomas
we have some (internal) plugin that modifies ticket field properties
on the fly. It hooks into /ticket and /query requests via
IRequestFilter.post_process_request() and modifies data['fields'].
This worked fine for older Trac versions. But newer Trac seems not to
use 'data' in /query requests anymore. Instead the ticket field
properties are passed in the global JS 'properties' variable (via
add_script_data()).
Now, in my plugin's post_process_request hook, I can also call
add_script_data(). Unfortunately, updating 'properties' doesn't really
work that way, as one can only replace whole keys.
One easy way would be to access req.chrome['script_data'] directly,
but that feels a bit like cheating (working around the API).
Another (more sledgehammery) way would be to add a JS snippet that
modifies 'properties'.
Is there some clean way in between?
Thanks,
Thomas
--
You received this message because you are subscribed to the Google Groups "Trac Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-dev+***@googlegroups.com.
To post to this group, send email to trac-***@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-dev.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "Trac Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-dev+***@googlegroups.com.
To post to this group, send email to trac-***@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-dev.
For more options, visit https://groups.google.com/d/optout.