Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#13439 closed defect (fixed)

AttributeError: 'int' object has no attribute 'resource'

Reported by: Peter Suter Owned by: Peter Suter
Priority: normal Component: WikiAutoCompletePlugin
Severity: normal Keywords:
Cc: Trac Release:


Reported by Nicolas Martin (ntmlod):

Spam filter plugin ... crash: 'Monitoring' (/admin/spamfilter/monitor) and 'Reports' (/admin/spamfilter/report). But the log refers to WikiAutoCompletePlugin

2018-06-10 20:57:39,539 Trac[main] ERROR: Internal Server Error:
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/trac/web/", line 497, in _dispatch_request
  File "/usr/lib/python2.7/site-packages/trac/web/", line 224, in dispatch
    self._post_process_request(req, *resp)
  File "/usr/lib/python2.7/site-packages/trac/web/", line 338, in _post_process_request
    resp = f.post_process_request(req, *resp)
  File "build/bdist.linux-x86_64/egg/wikiautocomplete/", line 60, in post_process_request
    if context_or_page and context_or_page.resource:
AttributeError: 'int' object has no attribute 'resource' 

source:wikiautocompleteplugin/trunk/wikiautocomplete/ is not working with data['page'] of type int in e.g. trac:source:plugins/1.0/spam-filter/tracspamfilter/,211,239,243#L211

Attachments (0)

Change History (5)

comment:1 Changed 2 years ago by Peter Suter

Maybe we should do something like this?

             context_or_page = data.get('context') or data.get('page')
-            if context_or_page and context_or_page.resource:
+            if (context_or_page and hasattr(context_or_page, 'resource')
+                and context_or_page.resource):
                 script_data['realm'] = context_or_page.resource.realm
                 script_data['id'] =

comment:2 Changed 2 years ago by Ryan J Ollos

The patch looks good to me.

comment:3 Changed 2 years ago by Peter Suter

In 17198:

WikiAutoCompletePlugin: Avoid problems with SpamFilterPlugin where page is int.
(see #13439)

comment:4 Changed 2 years ago by Peter Suter

Resolution: fixed
Status: newclosed


Last edited 2 years ago by Peter Suter (previous) (diff)

comment:5 Changed 2 years ago by ntmlod

Checked, it's fine :-)


Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Peter Suter.
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.