Ticket #3655 (closed defect: fixed)
IRequestFilter pre-processor - either implementation or documentation is wrong
| Reported by: | simon-code@… | Owned by: | cboos |
|---|---|---|---|
| Priority: | normal | Milestone: | 0.10 |
| Component: | general | Version: | devel |
| Severity: | normal | Keywords: | |
| Cc: |
Description
Documentation for pre-processor in trac.web.api.IRequestFilter says ...typically adding values to req.hdf...
But, looking at trac.web.main init and dispatching code, the HDF object isn't initialised when the pre-processor is called. That makes it impossible to manipulate req.hdf - see /trunk/trac/web/main.py@3602#L175
I need to set values to the HDF that is always available for my various custom templates, styles and plugins. Using the post processor works fine, except when there is any kind of error - and the req processing is halted immediately...
I made an early request for this interface in #2724, and having used it now I still think it makes sense to have 2 pre-processors - one as the current (before most init) that can influence handler choice and even allow for 'application embedding', and one that is used for setting/adjusting new and Trac generated information for all handlers before sending to processing.
However, sticking with one pre-processor, I think that the intent of the documentation is correct and most useful for now - and that the filters call should be moved down to line +/-214.


