#5408 closed defect (wontfix)
'trac.web.chrome.add_script' called from 'INavigationContributor.get_navigation_items()'
Reported by: | Owned by: | Jonas Borgström | |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | general | Version: | devel |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
If within a class that implements INavigationContributor the add_script( or 'add_xxx' ) method is called from get_navigation_items(), an infinite loop it's generated.
Reason: The get_navigation_items() it's called in Chrome.prepare_request() before req.chrome object it's created.
Attachments (1)
Change History (5)
by , 18 years ago
Attachment: | traceback.txt added |
---|
comment:1 by , 17 years ago
The kind of error you got is something that is likely to happen when you use the API in a way that is not intended. And, usually you quickly see that it is not working and look for alternative solutions.
In my opinion, the IRequestFilter.post_process_request()
is the correct location to add scripts - or of course the IRequestHandler
if you are adding scripts to your own handler. However, note ticket #5594 where the post-processor will not actually work if various errors occurs - it did work in 0.10 though, and hopefully will again soon..
Adding error checking for various 'creative' uses of the API by developers when good alternatives exist, is something I think is not very high on the list of priorities. Once #5594 got fixed, would you be happy to change your code to use alternative interface - and close this ticket as 'wontfix'?
comment:2 by , 17 years ago
Yes, you're right. Actually I've discovered this while I was trying to make ctxtnavadd plugin to work on 0.11.
(Sorry for late response)
comment:3 by , 17 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
as requested, osimons proposed to use #5594 interface
comment:4 by , 17 years ago
Milestone: | 0.11.1 |
---|
traceback