Edgewall Software
Modify

Opened 18 years ago

Closed 17 years ago

Last modified 17 years ago

#5408 closed defect (wontfix)

'trac.web.chrome.add_script' called from 'INavigationContributor.get_navigation_items()'

Reported by: catalin.balan@… 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)

traceback.txt (156.8 KB ) - added by catalin.balan@… 18 years ago.
traceback

Download all attachments as: .zip

Change History (5)

by catalin.balan@…, 18 years ago

Attachment: traceback.txt added

traceback

comment:1 by osimons <simon-code@…>, 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 catalin.balan@…, 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 ThurnerRupert, 17 years ago

Resolution: wontfix
Status: newclosed

as requested, osimons proposed to use #5594 interface

comment:4 by Christian Boos, 17 years ago

Milestone: 0.11.1

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jonas Borgström.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Jonas Borgström to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.