Skip to content

Commit

Permalink
fix: make task index not crash.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
rouilj committed Nov 6, 2023
1 parent 0af4484 commit 954218b
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 12 deletions.
2 changes: 2 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ Fixed:
- fix repeated password id with user.item.html in all templates except
jinja2. (John Rouillard)
- fix unclosed file when saving index in indexer_dbm.py. (John Rouillard)
- fix task index in devel tracker so it doesn't cause a crash if all
fields are selected. (John Rouillard)

Features:

Expand Down
18 changes: 18 additions & 0 deletions doc/upgrading.txt
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,24 @@ to::

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

Merge changes from devel template task.index.html (optional)
------------------------------------------------------------

The devel template's ``task.index.html`` has some fields that are not
defined in the schema. It looks like it was originally copied from the
``bug.index.html``. If the task index is requested without specifying
the columns/fields, the template will crash trying to display
``severity`` and other fields that don't exist in the task schema.

In normal use, the left hand menu for tasks always specifies valid
columns so you may not see this issue. However if you remove the
``@columns`` query parameter, you can see the error.

The removed columns are: severity, versions, keywords, dependencies.

It is also missing the ``solves`` field which is added to match the
schema.

Bad Login Rate Limiting and Locking (info)
------------------------------------------

Expand Down
15 changes: 3 additions & 12 deletions share/roundup/templates/devel/html/task.index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,17 @@
<tal:block tal:define="batch request/batch" tal:condition="context/is_view_ok">
<table class="list">
<tr>
<th tal:condition="request/show/severity" i18n:translate="">Severity</th>
<th tal:condition="request/show/id" i18n:translate="">ID</th>
<th tal:condition="request/show/creation" i18n:translate="">Creation</th>
<th tal:condition="request/show/activity" i18n:translate="">Activity</th>
<th tal:condition="request/show/actor" i18n:translate="">Actor</th>
<th tal:condition="request/show/title" i18n:translate="">Title</th>
<th tal:condition="request/show/components" i18n:translate="">Components</th>
<th tal:condition="request/show/versions" i18n:translate="">Versions</th>
<th tal:condition="request/show/status" i18n:translate="">Status</th>
<th tal:condition="request/show/resolution" i18n:translate="">Resolution</th>
<th tal:condition="request/show/creator" i18n:translate="">Creator</th>
<th tal:condition="request/show/assignee" i18n:translate="">Assigned&nbsp;To</th>
<th tal:condition="request/show/keywords" i18n:translate="">Keywords</th>
<th tal:condition="request/show/dependencies" i18n:translate="">Depends On</th>
<th tal:condition="request/show/solves" i18n:translate="">Solves</th>
<th tal:condition="request/show/type" i18n:translate="">Type</th>
</tr>
<tal:block tal:repeat="i batch" condition="true">
Expand All @@ -50,8 +47,6 @@
</tr>

<tr tal:attributes="class python:['even','odd'][repeat['i'].even()]">
<td tal:condition="request/show/severity"
tal:content="python:i.severity.plain() or default">&nbsp;</td>
<td tal:condition="request/show/id" tal:content="i/id">&nbsp;</td>
<td class="date" tal:condition="request/show/creation"
tal:content="i/creation/reldate">&nbsp;</td>
Expand All @@ -65,8 +60,6 @@
</td>
<td tal:condition="request/show/components"
tal:content="python:i.components.plain() or default">&nbsp;</td>
<td tal:condition="request/show/versions"
tal:content="python:i.versions.plain() or default">&nbsp;</td>
<td tal:condition="request/show/status"
tal:content="python:i.status.plain() or default">&nbsp;</td>
<td tal:condition="request/show/resolution"
Expand All @@ -75,10 +68,8 @@
tal:content="python:i.creator.plain() or default">&nbsp;</td>
<td tal:condition="request/show/assignee"
tal:content="python:i.assignee.plain() or default">&nbsp;</td>
<td tal:condition="request/show/keywords"
tal:content="python:i.keywords.plain() or default">&nbsp;</td>
<td tal:condition="request/show/dependencies"
tal:content="python:i.dependencies.plain() or default">&nbsp;</td>
<td tal:condition="request/show/solves"
tal:content="python:i.solves.plain() or default">&nbsp;</td>
<td tal:condition="request/show/type"
tal:content="python:i.type.plain() or default">&nbsp;</td>
</tr>
Expand Down

0 comments on commit 954218b

Please sign in to comment.