Modify

Opened 16 years ago

Closed 16 years ago

#3365 closed defect (fixed)

IndexError: list index out of range peerReviewView.html

Reported by: ron@… Owned by: Sebastian Marek
Priority: normal Component: PeerReviewPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11

Description (last modified by Sebastian Marek)

Error: IndexError: list index out of range

When user searches for code reviews or views any that aren't theirs the Index error appears when they choose one of the reviews that appears. There error happens on http://192.168.2.33/trac/peerReviewView?Review=2 for example.

Quick Fix: edit the html in /tmp/.pythoneggs/ and in the templates and on the peerReviewView.html Edit the following to look like example beneath it:

<tr py:if="filesLength > 0" py:for="item in rvs" class="${cls.next()}">

<td>${item[0]}</td> <td>${item[1]}</td>

</tr>

<tr py:if="filesLength > 0" py:for="item in rvs" class="${cls.next()}">

<td>${item[0]}</td>

</tr>

The problem is if you restart trac this change is not there.

Traceback:

File "/tmp/.python-eggs/TracCodeReview-2.1_toddlerdev_r0-py2.4.egg-tmp/codereview/templates/peerReviewView.html", line 93, in <Expression u'item[1]'>

<td>${item[1]}</td>

System Info:

System Information:

User Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.15) Gecko/20080702 Fedora/2.0.0.15-1.fc8 Firefox/2.0.0.15 Trac: 0.11 Python: 2.4.3 (#1, May 24 2008, 13:47:28) [GCC 4.1.2 20070626 (Red Hat 4.1.2-14)] setuptools: 0.6c8 SQLite: 3.3.6 pysqlite: 1.1.7 Genshi: 0.5 mod_python: 3.2.8 Pygments: 0.10 jQuery: 1.2.3

Attachments (0)

Change History (6)

comment:1 Changed 16 years ago by ron@…

Trac Release: 0.100.11

Quick edit: Trac version

comment:2 Changed 16 years ago by Nate

We are also getting this error, and it's pretty much a showstopper for us, as peer review was the thing that attracted us to Trac.

comment:3 Changed 16 years ago by Nate

Okay, I fixed this in our local install. There are a few bugs in PeerReviewView.py (at least in the 2.1toddler version we're on):

  1. There is a numeric flag in datamanager? that is being compared to a string RESULT: code review managers don't get recognized as such
  1. When the viewing user is neither the code review author nor a manager, only one item is placed in the newrvpair array. When later checked at PierReviewView.html:93, the code displays contents of newrvpair[1] without checking whether it actually exists RESULT: the IndexError described in this issue.

comment:4 Changed 16 years ago by NateClark

Nate again - I just registered as an actual user. Presumably that will allow you to contact me if desired. If not, here: nate.clark at_symbol brulant dot_symbol com

comment:5 Changed 16 years ago by anonymous

I had the same problem, I then changed the line causing the problem to the following and reinstalled the plugin.

<td py:if="len(item) >= 2">${item[1]}</td>

comment:6 Changed 16 years ago by Sebastian Marek

Description: modified (diff)
Resolution: fixed
Status: newclosed

Fixed on 2.2-dev branch

Modify Ticket

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