Edgewall Software
Modify

Ticket #9528 (reopened defect)

Opened 19 months ago

Last modified 17 months ago

Failed to highlight active mainnav item if `RepositoryManager` is enabled

Reported by: olemis+trac@… Owned by:
Priority: normal Milestone: next-minor-0.12.x
Component: web frontend Version: 0.12
Severity: minor Keywords: mainnav RepositoryManager
Cc:
Release Notes:
API Changes:

Description

I am experiencing an odd behavior using Trac and ThemeEnginePlugin . The problem is that active CSS class is not added to active mainnav item. Everything works ok if I disable RepositoryManager . I've tried to find the exact location where the problem happens , but without success . The only things I can say so far are :

  • handler var is set to None when calling Chrome.prepare_data ...
  • ... therefore active var is also set to None , and item is not highlighted in mainnav ...
  • ... the strange fact is that at that time , the partial object has already been installed for chosen_handler inside RequestDispatcher.dispach since req.callbacks['chrome'].keywords.items() contains the correct binding for handler key.
  • the signature of RepositoryManager.post_process_request is post_process_request(self, req, template, content_type) , is it suitable to be used with Genshi templates ?

PS: Posted here 'cause I think there's a problem with Trac rather than the plugin .

Attachments

Change History

comment:1 follow-up: Changed 17 months ago by cboos

  • Resolution set to cantfix
  • Status changed from new to closed

Is there a problem without the theme engine plugin? If yes, please reopen. Otherwise I'm afraid you're on your own.

comment:2 in reply to: ↑ 1 ; follow-up: Changed 17 months ago by anonymous

  • Resolution cantfix deleted
  • Status changed from closed to reopened

Replying to cboos:

Is there a problem without the theme engine plugin? If yes, please reopen. Otherwise I'm afraid you're on your own.

The problem is that if a filter instantiates req.chrome inside pre_process_request then process_data is not wrapped using functools.partial, hence it doesn't receive active handler , and finally there's no mainnav highlighted.

comment:3 in reply to: ↑ 2 Changed 17 months ago by olemis+trac@…

Replying to anonymous:

Replying to cboos:

Is there a problem without the theme engine plugin? If yes, please reopen. Otherwise I'm afraid you're on your own.

The problem is that if a filter instantiates req.chrome inside pre_process_request then process_data is not wrapped using functools.partial, hence it doesn't receive active handler , and finally there's no mainnav highlighted.


... even if req.callbacks['chrome'].keywords.items() contains the correct binding for handler key , because that setup happened after instantiating chrome attribute .

comment:4 Changed 17 months ago by cboos

  • Component changed from version control to web frontend
  • Milestone set to next-minor-0.12.x
  • Severity changed from normal to minor
  • Version set to 0.12

Ok, seems worth having a look.

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as reopened
as The resolution will be set. Next status will be 'closed'
to The owner will be changed from (none). Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.