Ticket #6905 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

AttributeError: 'NoneType' object has no attribute 'navpath'

Reported by: anonymous Assigned to: rudyryk
Priority: normal Component: FlexibleWikiPlugin
Severity: normal Keywords:
Cc: spudboy@nmt.edu 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

navigation.py-patch (1.5 kB) - added by bellaire on 04/05/10 20:13:25.
patch for navigation.py

Change History

03/31/10 00:16:45 changed by rudyryk

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.

(follow-up: ↓ 3 ) 04/05/10 20:11:57 changed by bellaire

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.

04/05/10 20:13:25 changed by bellaire

  • attachment navigation.py-patch added.

patch for navigation.py

(in reply to: ↑ 2 ) 04/05/10 23:13:06 changed by rudyryk

  • status changed from new to closed.
  • resolution set to fixed.

Replying to bellaire:

This seems to fix the problem.

Hi, bellaire! Thank you for providing patch. I've applied with minor modifications and tested locally on 0.11.7 version. It seems to work for now.


Add/Change #6905 (AttributeError: 'NoneType' object has no attribute 'navpath')




Change Properties
Action