Commits

Alex Willmer committed 01f3c16

Display id of invalid linked tickets in linked tickets table

Comments (0)

Files changed (2)

trac/ticket/templates/ticket_box.html

           <td class="summary">${shorten_line(ticket.summary)}</td>
           <td class="date">${dateinfo(ticket.changetime)}</td>
         </tr>
+        <tr py:for="link, tkt_id in linked_rejects">
+          <td class="ticket_link">${link}</td>
+          <td class="ticket">${tkt_id}</td>
+          <td class="reject" colspan="4">Ticket details unavailable</td>
+        </tr>
       </tbody>
     </table>
   </div>

trac/ticket/web_ui.py

         linked_rejects = []
         for field in link_fields:
             for tkt_id in ticket_sys.parse_links(ticket[field['name']]):
+                tkt_fmt = format_to_oneliner(self.env, context, 
+                                             '#%s' % tkt_id)
                 try:
                     tkt = Ticket(self.env, tkt_id)
-                    tkt_fmt = format_to_oneliner(self.env, context, 
-                                                 '#%s' % tkt.id)
                     linked_tickets.append((field['label'], tkt_fmt, tkt))
                 except ResourceNotFound:
-                    linked_rejects.append(tkt_id)
+                    linked_rejects.append((field['label'], tkt_fmt))
                 
         return {'ticket': ticket,
                 'linked_tickets': linked_tickets,
+                'linked_rejects': linked_rejects,
                 'newlinked_options': new_linked,
                 'context': context,
                 'preserve_newlines': self.must_preserve_newlines}