Modify

Opened 16 years ago

Closed 15 years ago

#3995 closed defect (fixed)

Wiki mainnav tab does not atcivate correctly

Reported by: Aaron Camac Owned by: Robert Corsaro
Priority: normal Component: AnnouncerPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11

Description

It looks like this might have started after Trac implemented this CR #3655, no longer supporting changing the request as part of pre_process_request(). This causes the prepare_request() to be called without a handler which cause the activation not to be checked. See callstack below. Just move this to post_process_request().

  • announcerplugin/announcerplugin/subscribers/watchers.py

     
    132132            db.commit()
    133133           
    134134    # IRequestFilter methods
    135     def pre_process_request(self, req, handler):
     135    def pre_process_request(self, req, handler):   
     136        return handler
     137       
     138    def post_process_request(self, req, template, data, content_type):
    136139        self._add_notice(req)
    137140       
    138141        if req.authname != "anonymous" or (req.authname == 'anonymous' and 'email' in req.session):
     
    146149                   
    147150                    self.render_watcher(req)
    148151                    break
    149                    
    150         return handler
    151        
    152     def post_process_request(self, req, template, data, content_type):
    153152        return (template, data, content_type)
    154153
    155154    # Internal methods

Tab activation does NOT work

File "/usr/lib/python2.4/site-packages/Trac-0.11.1-py2.4.egg/trac/web/main.py", line 394, in dispatch_request
    return _dispatch_request(req, env, env_error)
File "/usr/lib/python2.4/site-packages/Trac-0.11.1-py2.4.egg/trac/web/main.py", line 423, in _dispatch_request
    dispatcher.dispatch(req)
File "/usr/lib/python2.4/site-packages/Trac-0.11.1-py2.4.egg/trac/web/main.py", line 173, in dispatch
    chosen_handler)
File "/usr/lib/python2.4/site-packages/Trac-0.11.1-py2.4.egg/trac/web/main.py", line 286, in _pre_process_request
    chosen_handler = filter_.pre_process_request(req, chosen_handler)
File "/usr/lib/python2.4/site-packages/TracVote-0.1-py2.4.egg/tracvote/__init__.py", line 139, in pre_process_request
    self.render_voter(req)
File "/usr/lib/python2.4/site-packages/TracVote-0.1-py2.4.egg/tracvote/__init__.py", line 180, in render_voter
    add_script(req, \'vote/js/tracvote.js\')
File "/usr/lib/python2.4/site-packages/Trac-0.11.1-py2.4.egg/trac/web/chrome.py", line 92, in add_script
    scriptset = req.chrome.setdefault(\'scriptset\', set())
File "/usr/lib/python2.4/site-packages/Trac-0.11.1-py2.4.egg/trac/web/api.py", line 169, in __getattr__
    value = self.callbacks[name](self)
File "/usr/lib/python2.4/site-packages/Trac-0.11.1-py2.4.egg/trac/web/chrome.py", line 460, in prepare_request
    self.log.info(traceback.format_stack())

Tab activation does work

File "/usr/lib/python2.4/site-packages/Trac-0.11.1-py2.4.egg/trac/web/main.py", line 394, in dispatch_request
    return _dispatch_request(req, env, env_error)
File "/usr/lib/python2.4/site-packages/Trac-0.11.1-py2.4.egg/trac/web/main.py", line 423, in _dispatch_request
    dispatcher.dispatch(req)
File "/usr/lib/python2.4/site-packages/Trac-0.11.1-py2.4.egg/trac/web/main.py", line 197, in dispatch
    resp = chosen_handler.process_request(req)
File "/usr/lib/python2.4/site-packages/Trac-0.11.1-py2.4.egg/trac/ticket/roadmap.py", line 352, in process_request
    \'ics\')
File "/usr/lib/python2.4/site-packages/Trac-0.11.1-py2.4.egg/trac/web/chrome.py", line 59, in add_link
    linkset = req.chrome.setdefault(\'linkset\', set())
File "/usr/lib/python2.4/site-packages/Trac-0.11.1-py2.4.egg/trac/web/api.py", line 169, in __getattr__
    value = self.callbacks[name](self)
File "/usr/lib/python2.4/site-packages/Trac-0.11.1-py2.4.egg/trac/util/compat.py", line 133, in newfunc
    return func_(*(args + fargs), **dict(kwargs, **fkwargs))
File "/usr/lib/python2.4/site-packages/Trac-0.11.1-py2.4.egg/trac/web/chrome.py", line 460, in prepare_request
    self.log.info(traceback.format_stack())

Attachments (0)

Change History (5)

comment:1 Changed 16 years ago by Aaron Camac

The callstack shows the VotePlugin but you have the same problem.

comment:2 Changed 15 years ago by Robert Corsaro

I'm not sure what the problem is, exactly. I just tested with trac r7733 (trunk) and it works fine without the patch. I don't understand the title of this ticket. Can you explain in more detail, exactly what the issue is?

comment:3 Changed 15 years ago by anonymous

Owner: changed from Stephen Hansen to Robert Corsaro

comment:4 Changed 15 years ago by Aaron Camac

Sorry... I was too knee deep into the code to give a good synopsis.

The problem is that the wiki tab does not get highlighted when it is selected, aka changes to black background with white letters. This is due to your watch logic.

comment:5 Changed 15 years ago by anonymous

Resolution: fixed
Status: newclosed

Ah, that makes sense. fixed in r4946

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Robert Corsaro.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


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

 
Note: See TracTickets for help on using tickets.