Opened 15 years ago
Closed 15 years ago
#6905 closed defect (fixed)
AttributeError: 'NoneType' object has no attribute 'navpath'
Reported by: | anonymous | Owned by: | Alexey Kinyov |
---|---|---|---|
Priority: | normal | Component: | FlexibleWikiPlugin |
Severity: | normal | Keywords: | |
Cc: | spudboy@… | Trac Release: | 0.11 |
Description
trac-0.11.6-1.fc12 flexiblewikiplugin rev 5589
get this after enabling plugin and restarting apache:
Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/trac/web/api.py", line 377, in send_error
'text/html')
File "/usr/lib/python2.6/site-packages/trac/web/chrome.py", line 739, in render_template
data = self.populate_data(req, data)
File "/usr/lib/python2.6/site-packages/trac/web/chrome.py", line 639, in populate_data
dchrome?.update(req.chrome)
File "/usr/lib/python2.6/site-packages/trac/web/api.py", line 195, in getattr
value = self.callbacks[name](self)
File "/usr/lib/python2.6/site-packages/trac/web/chrome.py", line 494, in prepare_request
for category, name, text in contributor.get_navigation_items(req):
File "build/bdist.linux-x86_64/egg/tracflexwiki/navigation.py", line 41, in get_navigation_items
href=req.href.flexwiki(action='new', page=req.args.get('node').navpath)))
AttributeError: 'NoneType' object has no attribute 'navpath'
Attachments (1)
Change History (4)
comment:1 Changed 15 years ago by
comment:2 follow-up: 3 Changed 15 years ago by
It looks like there are multiple requests being dispatched (???). I added some tracing information to the debugging log, and in the first and third cases the plugin behaved as expected, but during the second request processing, get_navigation_items is invoked without pre_process_request being called first, so the node never gets populated at that step.
I have no idea why this is happening or what changes in Trac core caused it. However, I have written a small patch for navigation.py
which should fix the problem by simply abstracting the check for node
data into a subroutine. We then check whether the node data has been fetched yet at both places (in pre_process_request and in get_navigation_items), and if it is not present, obtain it.
This seems to fix the problem.
comment:3 Changed 15 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
I've tried to fix it for current stable release of Trac, but that seems not obvious. I didn't find the way of storing data per-request basis. So, the project is unmaintained at the moment and will stay so for unpredictable period.