Modify

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#12713 closed defect (fixed)

Error when searching in Forms

Reported by: ntmlod Owned by: Ryan J Ollos
Priority: normal Component: TracFormsPlugin
Severity: normal Keywords:
Cc: Trac Release: 1.0

Description

Some words have generated an error when I searched them in Trac.
It seems maybe this bug is a joint error between the TracForms and PrivateWiki plugins. If I removed the PrivateWikis-*.egg file or I unchecked 'Forms' in the searching parameters, everything gets back to normal.

I avoid this issue by disabling by default the searching filter for 'forms' in the trac.ini

How to Reproduce

While doing a GET operation on /search, Trac issued an internal error.

(please provide additional details here)

Request parameters:

{'changeset': u'on',
 'discussion': u'on',
 'form': u'on',
 'milestone': u'on',
 'noquickjump': u'1',
 'q': u'nemo',
 'ticket': u'on',
 'wiki': u'on'}

User agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/38.0.2125.111 Chrome/38.0.2125.111 Safari/537.36

System Information

Trac 1.0.1
Genshi 0.6 (without speedups)
psycopg2 2.4.6
Pygments 1.6
Python 2.7.6 (default, Mar 18 2014, 22:18:46)
[GCC 4.8.2]
setuptools 0.9.8
Subversion 1.8.8 (r1568071)
jQuery 1.7.2

Enabled Plugins

AllAttachments r14371
Cards 1.2
ChangeLogMacro 0.4dev
Color r11892
EmailProcessor r10962
FootNoteMacro 1.05
GridModify 0.1.6dev-r12235
LastModified r13555
LogViewerPlugin 0.2-r13412
Navigation-Plugin 0.2.0
NeighborPagePlugin 0.2
PageTicketsMacro N/A
PrivateWikis 1.0.0
SVN-MULTI-URLs 0.3
TicketBox r7516
Timestamp N/A
TracAccountManager 0.5dev
TracAcronyms 0.2
TracAdvParseArgsPlugin 0.4
TracAttachmentNumMacro 0.7
TracAutocompleteUsersPlugin 0.4.3dev-r14213
TracAutoWikify 0.2
TracDiscussion 0.9dev
TracExtractUrl 0.3
TracForms 0.5dev-r11562
TracIncludeMacro 3.0.0dev
TracIniAdminPanel 0.81beta-r12768
TracIniGetMacro 0.11.3
TracListOfWikiPagesMacro 0.4
TracMenusPlugin 0.1.1-r12147
TracNewsFlash 1.0.2
TracPermRedirect 3.0
TracPoll 0.3.0dev
TracReportManager 0.1
TracRevtreePlugin 0.7.0dev-r13844
TracSectionEditPlugin 0.2.6-r11208
TracServerSideRedirectPlugin 1.0.0
TracStats 0.5
Tracticketstats 3.0.0dev-r14703
TracTicketTemplate 1.0dev
TracTocMacro 11.0.0.5
TracUserManagerPlugin 0.5dev
TracUsernameDecoratePlugin 0.12.0.1
TracWikiNotification 0.4
TracWikiReplace 1.1.2dev
TracWikiToPdfPlugin 2.3.1dev-r13441
TracWysiwyg 0.12.0.5-r13457
WantedPages 0.5.1dev-r14534
WikiAutoComplete 1.0
WikiCalendarMacro 2.1.1dev
Wikinfo 0.2dev
WikiReport 0.1.0

Python Traceback

Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/trac/web/main.py", line 497, in _dispatch_request
    dispatcher.dispatch(req)
  File "/usr/lib/python2.7/site-packages/trac/web/main.py", line 214, in dispatch
    resp = chosen_handler.process_request(req)
  File "/usr/lib/python2.7/site-packages/trac/search/web_ui.py", line 106, in process_request
    results = self._do_search(req, terms, filters)
  File "/usr/lib/python2.7/site-packages/trac/search/web_ui.py", line 214, in _do_search
    or [])
  File "build/bdist.linux-x86_64/egg/tracforms/web_ui.py", line 218, in get_search_results
    if 'FORM_VIEW' in req.perm(form):
  File "/usr/lib/python2.7/site-packages/trac/perm.py", line 556, in has_permission
    return self._has_permission(action, resource)
  File "/usr/lib/python2.7/site-packages/trac/perm.py", line 570, in _has_permission
    check_permission(action, perm.username, resource, perm)
  File "/usr/lib/python2.7/site-packages/trac/perm.py", line 462, in check_permission
    perm)
  File "build/bdist.linux-x86_64/egg/privatewiki/api.py", line 27, in check_permission
    log_msg_vars = (str(action), str(username), str(resource), str(perm))
  File "/usr/lib/python2.7/site-packages/trac/resource.py", line 118, in __repr__
    return '<Resource %r>' % (', '.join(reversed(path)))
TypeError: sequence item 0: expected string, Form found

Attachments (0)

Change History (4)

comment:1 Changed 8 years ago by Ryan J Ollos

In 15446:

0.5dev: Remove tag_svn_revision

The attribute is not supported in setuptools >= 10

Refs #12713.

comment:2 Changed 8 years ago by Ryan J Ollos

Resolution: fixed
Status: newclosed

In 15447:

0.5dev: Fix incorrect permission check using Form object

Fixes #12713.

comment:3 Changed 8 years ago by Ryan J Ollos

Owner: changed from Steffen Hoffmann to Ryan J Ollos

comment:4 Changed 8 years ago by ntmlod

Thanks rjollos, I updated the plugin with your last revision.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
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.