Modify

Opened 10 years ago

Closed 10 years ago

#11957 closed defect (duplicate)

Fix for using timeline and discussion forum reply/quote with Trac 1.0.1

Reported by: anonymous Owned by:
Priority: normal Component: DiscussionPlugin
Severity: major Keywords:
Cc: Trac Release: 1.0

Description

Hi

we upgraded an old Trac installation to v1.0.x and had some problems with the discussion plugin. Using the suggested r13910 the quote and reply links in the forum lead to an error when used with already existing answers (with the main topic they worked):

2014-08-26 10:08:22,295 Trac[main] ERROR: Internal Server Error:
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/Trac-1.0.1-py2.6.egg/trac/web/main.py", line 497, in _dispatch_request
    dispatcher.dispatch(req)
  File "/usr/lib/python2.6/site-packages/Trac-1.0.1-py2.6.egg/trac/web/main.py", line 214, in dispatch
    resp = chosen_handler.process_request(req)
  File "build/bdist.linux-x86_64/egg/tracdiscussion/core.py", line 117, in process_request
    template, data = api.process_discussion(context)
  File "build/bdist.linux-x86_64/egg/tracdiscussion/api.py", line 291, in process_discussion
    self._do_actions(context, actions)
  File "build/bdist.linux-x86_64/egg/tracdiscussion/api.py", line 1342, in _do_actions
    self._prepare_message_list(context, context.topic)
  File "build/bdist.linux-x86_64/egg/tracdiscussion/api.py", line 1501, in _prepare_message_list
    .attachment_data(context)
  File "/usr/lib/python2.6/site-packages/Trac-1.0.1-py2.6.egg/trac/attachment.py", line 559, in attachment_data
    context.href),
  File "/usr/lib/python2.6/site-packages/Trac-1.0.1-py2.6.egg/trac/resource.py", line 297, in get_resource_url
    return manager.get_resource_url(resource, href, **kwargs)
  File "/usr/lib/python2.6/site-packages/Trac-1.0.1-py2.6.egg/trac/attachment.py", line 650, in get_resource_url
    resource.parent(version=None), Href('')))
  File "/usr/lib/python2.6/site-packages/Trac-1.0.1-py2.6.egg/trac/resource.py", line 297, in get_resource_url
    return manager.get_resource_url(resource, href, **kwargs)
  File "build/bdist.linux-x86_64/egg/tracdiscussion/api.py", line 202, in get_resource_url
    (self.get_resource_url(resource.parent, href),
  File "build/bdist.linux-x86_64/egg/tracdiscussion/api.py", line 198, in get_resource_url
    if resource.id:
AttributeError: 'NoneType' object has no attribute 'id'

Upgrading to r13945 helped, but now there were errors in the timeline:

2014-08-26 10:51:26,409 Trac[web_ui] ERROR: Timeline event provider failed:
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/Trac-1.0.1-py2.6.egg/trac/timeline/web_ui.py", line 194, in process_request
    filters) or []:
  File "/usr/lib/python2.6/site-packages/TracDiscussion-0.9dev_r13945-py2.6.egg/tracdiscussion/timeline.py", line 67, in get_timeline_events
    for topic in api.get_changed_topics(context, start, stop):
  File "/usr/lib/python2.6/site-packages/TracDiscussion-0.9dev_r13945-py2.6.egg/tracdiscussion/model.py", line 242, in get_changed_topics
    for row in cursor]
TypeError: tuple indices must be integers, not str

The problem seems to be the sql query which does not take the "columns" into account. I tried a workaround by changing a single line (line 241) from

status=topic_status_to_list(row['status']))

to

status=topic_status_to_list(row[columns.index('status')]))

to avoid the error and this fixed the problem for now. Of course this is just a workaround and I hope there is somebody who can implement a real fix. Just wanted to let you know and thanks for all the good work!

Best regards, Tom

Here is what we are currently using:

DiscussionPlugin: 0.9dev-r13945 Trac: 1.0.1 Server: Apache 2.2.15 OS: Linux CentOS release 6.5

Attachments (0)

Change History (1)

comment:1 Changed 10 years ago by Jun Omae

Resolution: duplicate
Status: newclosed

A duplicate of #11902.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The ticket will remain with no owner.
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.