Skip to content

Commit 954218b

Browse files
committed
fix: make task index not crash.
It looks like the task.index.html page was a copy of bug.index.html. However some fields are missing from a task that is in a bug. This causes a crash when looking at all tasks if you don't explicitly select the fields to be displayed. The task links from the sidebar do explicitly select @columns fields, so the crash is not normally seen.
1 parent 0af4484 commit 954218b

File tree

3 files changed

+23
-12
lines changed

3 files changed

+23
-12
lines changed

CHANGES.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ Fixed:
7474
- fix repeated password id with user.item.html in all templates except
7575
jinja2. (John Rouillard)
7676
- fix unclosed file when saving index in indexer_dbm.py. (John Rouillard)
77+
- fix task index in devel tracker so it doesn't cause a crash if all
78+
fields are selected. (John Rouillard)
7779

7880
Features:
7981

doc/upgrading.txt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,24 @@ to::
135135

136136
This will change the id to ``confirm_password``.
137137

138+
Merge changes from devel template task.index.html (optional)
139+
------------------------------------------------------------
140+
141+
The devel template's ``task.index.html`` has some fields that are not
142+
defined in the schema. It looks like it was originally copied from the
143+
``bug.index.html``. If the task index is requested without specifying
144+
the columns/fields, the template will crash trying to display
145+
``severity`` and other fields that don't exist in the task schema.
146+
147+
In normal use, the left hand menu for tasks always specifies valid
148+
columns so you may not see this issue. However if you remove the
149+
``@columns`` query parameter, you can see the error.
150+
151+
The removed columns are: severity, versions, keywords, dependencies.
152+
153+
It is also missing the ``solves`` field which is added to match the
154+
schema.
155+
138156
Bad Login Rate Limiting and Locking (info)
139157
------------------------------------------
140158

share/roundup/templates/devel/html/task.index.html

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,17 @@
2323
<tal:block tal:define="batch request/batch" tal:condition="context/is_view_ok">
2424
<table class="list">
2525
<tr>
26-
<th tal:condition="request/show/severity" i18n:translate="">Severity</th>
2726
<th tal:condition="request/show/id" i18n:translate="">ID</th>
2827
<th tal:condition="request/show/creation" i18n:translate="">Creation</th>
2928
<th tal:condition="request/show/activity" i18n:translate="">Activity</th>
3029
<th tal:condition="request/show/actor" i18n:translate="">Actor</th>
3130
<th tal:condition="request/show/title" i18n:translate="">Title</th>
3231
<th tal:condition="request/show/components" i18n:translate="">Components</th>
33-
<th tal:condition="request/show/versions" i18n:translate="">Versions</th>
3432
<th tal:condition="request/show/status" i18n:translate="">Status</th>
3533
<th tal:condition="request/show/resolution" i18n:translate="">Resolution</th>
3634
<th tal:condition="request/show/creator" i18n:translate="">Creator</th>
3735
<th tal:condition="request/show/assignee" i18n:translate="">Assigned&nbsp;To</th>
38-
<th tal:condition="request/show/keywords" i18n:translate="">Keywords</th>
39-
<th tal:condition="request/show/dependencies" i18n:translate="">Depends On</th>
36+
<th tal:condition="request/show/solves" i18n:translate="">Solves</th>
4037
<th tal:condition="request/show/type" i18n:translate="">Type</th>
4138
</tr>
4239
<tal:block tal:repeat="i batch" condition="true">
@@ -50,8 +47,6 @@
5047
</tr>
5148

5249
<tr tal:attributes="class python:['even','odd'][repeat['i'].even()]">
53-
<td tal:condition="request/show/severity"
54-
tal:content="python:i.severity.plain() or default">&nbsp;</td>
5550
<td tal:condition="request/show/id" tal:content="i/id">&nbsp;</td>
5651
<td class="date" tal:condition="request/show/creation"
5752
tal:content="i/creation/reldate">&nbsp;</td>
@@ -65,8 +60,6 @@
6560
</td>
6661
<td tal:condition="request/show/components"
6762
tal:content="python:i.components.plain() or default">&nbsp;</td>
68-
<td tal:condition="request/show/versions"
69-
tal:content="python:i.versions.plain() or default">&nbsp;</td>
7063
<td tal:condition="request/show/status"
7164
tal:content="python:i.status.plain() or default">&nbsp;</td>
7265
<td tal:condition="request/show/resolution"
@@ -75,10 +68,8 @@
7568
tal:content="python:i.creator.plain() or default">&nbsp;</td>
7669
<td tal:condition="request/show/assignee"
7770
tal:content="python:i.assignee.plain() or default">&nbsp;</td>
78-
<td tal:condition="request/show/keywords"
79-
tal:content="python:i.keywords.plain() or default">&nbsp;</td>
80-
<td tal:condition="request/show/dependencies"
81-
tal:content="python:i.dependencies.plain() or default">&nbsp;</td>
71+
<td tal:condition="request/show/solves"
72+
tal:content="python:i.solves.plain() or default">&nbsp;</td>
8273
<td tal:condition="request/show/type"
8374
tal:content="python:i.type.plain() or default">&nbsp;</td>
8475
</tr>

0 commit comments

Comments
 (0)