チケットを見る機能で、ストーリーのIDをクリックすると、エラーになる
お返事が遅くなりすみません。仕様です。Tracのレポートは、1行につき、チケットへのリンクが1つしか生成できないためこのような仕様になっています。
Tracを下記のように修正して再インストールすると修正できますが、レポートの仕様が変わってしまうので 影響を考えて修正するかどうか判断したいと思います。
--- trac/ticket/templates/report_view.html.org 2011-08-11 08:36:16.000000000 +0900 +++ trac/ticket/templates/report_view.html 2011-08-11 08:36:26.000000000 +0900 @@ -140,7 +140,7 @@ <py:when test="col in ('ticket', 'id')"> <td class="ticket" py:attrs="td_attrs"> <a title="${_('View %(realm)s', realm=row.resource.realm)}" - href="${url_of(row.resource)}">#$cell.value</a> + href="${href.ticket(cell.value)}">#$cell.value</a> <hr py:if="fullrow"/> </td> </py:when>
上記のコメントのようにテンプレートを修正しない方法として、レポートの SQL を以下の内容に変更してもらうと期待するような正常なストーリーIDのリンクを生成できるようになります。こちらをお試しください。
SELECT CASE tt.status WHEN 'closed' THEN 5 WHEN 'new' THEN 3 ELSE 1 END AS __color__, (CASE tt.status WHEN 'closed' THEN 'color: #777; background: #ddd; border-color: #ccc;' ELSE (CASE tt.owner WHEN $USER THEN 'font-weight: bold' END) END) AS __style__, tt.milestone AS __group__, t.id AS ticket, '' AS 'ストーリー', '[/ticket/'||tt.id||' #'||tt.id||']' AS description, tt.summary AS 'タスク', tt.owner AS '担当者', tt.status AS '状態', CASE WHEN st.child IS NULL THEN peh.value ELSE eh.value END AS '見積', CASE WHEN st.child IS NULL THEN pth.value ELSE th.value END AS '作業時間', '' AS 説明, t.id AS _id FROM ticket t LEFT JOIN subtickets st ON st.parent =t.id AND t.type='ストーリー' LEFT JOIN ticket tt ON tt.id=st.child LEFT JOIN milestone m ON t.milestone = m.name LEFT JOIN ticket_custom eh ON eh.ticket = tt.id AND eh.name = 'estimatedhours' LEFT JOIN ticket_custom th ON th.ticket = tt.id AND th.name = 'totalhours' LEFT JOIN ticket_custom peh ON peh.ticket = t.id AND peh.name = 'estimatedhours' LEFT JOIN ticket_custom pth ON pth.ticket = t.id AND pth.name = 'totalhours' WHERE t.type='ストーリー' AND st.child IS NOT NULL AND t.status <> 'closed' UNION SELECT 4 AS __color__, 'color: black; font-weight: bold;' AS __style__, t.milestone AS __group__, t.id AS ticket, t.summary AS 'ストーリー', '', '', '', '', '', '', '[/newticket?type=タスク&parents='||t.id||'&milestone='||t.milestone||' タスク作成]' AS 説明, t.id AS _id FROM ticket t WHERE t.type='ストーリー' AND t.status<>'closed' UNION SELECT CASE t.status WHEN 'closed' THEN 5 WHEN 'new' THEN 3 ELSE 1 END AS __color__, (CASE t.status WHEN 'closed' THEN 'color: #777; background: #ddd; border-color: #ccc;' ELSE (CASE t.owner WHEN $USER THEN 'font-weight: bold' END) END) AS __style__, t.milestone AS __group__, '-' AS ticket, 'その他:' ||t.type AS 'ストーリー', '[/ticket/'||t.id||' #'||t.id||']' AS description, t.summary as 'タスク', t.owner AS '担当者', t.status AS '状態', eh.value AS '見積', th.value AS '作業時間', '', NULL AS _id FROM ticket as t LEFT JOIN ticket_custom eh ON eh.ticket = t.id AND eh.name = 'estimatedhours' LEFT JOIN ticket_custom th ON th.ticket = t.id AND th.name = 'totalhours' WHERE NOT t.type IN ('ストーリー') AND NOT EXISTS (SELECT * from subtickets WHERE subtickets.child = t.id) ORDER BY __group__ DESC, ticket, description
確認しました。きちんと動きますね。
修正したレポートもr213でコミットしておきました。
以下の手順で操作し、「No handler mached request to /ticket」エラーになります。 1.アジャイルプロジェクトを作成する(/profile agile) 2.「チケットを登録する」機能で、ストーリーとしてチケットを登録する 3.「チケットを見る」機能で、チケット一覧が表示される 4.ストーリーのIDをクリックすると、エラーになる
不具合なのか、仕様であるでしょうか