Edgewall Software

Ticket #6556: report-6556.diff

File report-6556.diff, 3.5 KB (added by eblot, 4 years ago)

Patch proposal to fix up invalid RSS report feed.

  • Users/eblot/Sources/Svn/edgewall.org/trac/trunk/trac/ticket/report.py

     
    268268            self._send_sql(req, id, title, description, sql) 
    269269 
    270270        if id > 0: 
    271             title = '{%i} %s' % (id, title) 
     271            decorated_title = '{%i} %s' % (id, title) 
     272        else: 
     273            decorated_title = title 
    272274 
    273275        report_resource = Resource('report', id) 
    274276        context = Context.from_request(req, report_resource) 
    275         data = {'action': 'view', 'title': title, 
    276                 'report': {'id': id, 'resource': report_resource}, 
    277                 'context': context, 
    278                 'title': title, 'description': description, 
     277        data = {'action': 'view', 
     278                'report': {'id': id, 'resource': report_resource,  
     279                           'title' : title}, 
     280                'context': context, 'title': decorated_title,  
     281                'description': description, 
    279282                'args': args, 'message': None} 
    280283        try: 
    281284            cols, results = self.execute_report(req, db, id, sql, args) 
  • Users/eblot/Sources/Svn/edgewall.org/trac/trunk/trac/ticket/templates/report.rss

     
    55  <xi:include href="macros.rss" /> 
    66  <channel> 
    77    <title>$project.name: $report.title</title> 
    8     <link>${abs_href.report(report.id)}</link> 
     8    <link>${abs_href.report(report.id != -1 and report.id or '')}</link> 
    99    <description>Trac Report - $report.description</description> 
    1010    <language>en-us</language> 
    1111    <image py:if="chrome.logo.src"> 
    12       <title>$project.name</title> 
    13       <url>$chrome.logo.src</url> 
     12      <title>$project.name: $report.title</title> 
     13      <url>${ 
     14          chrome.logo.src_abs and chrome.logo.src_abs or abs_href(chrome.logo.src) 
     15        }</url> 
    1416      <link>${abs_href.report(report.id != -1 and report.id or '')}</link> 
    1517    </image> 
    1618    <generator>Trac v${trac.version}</generator> 
     
    2224            <py:when test="col == 'reporter'"> 
    2325              ${author_or_creator(cell.author, email_map)} 
    2426            </py:when> 
    25             <py:when test="col in ('time', 'changetime', 'created', 'modified')"> 
    26               <!-- FIXME: we end up with multiple pubDate --> 
    27               <pubDate py:if="cell.value != 'None'">${http_date(fromtimestamp(int(cell.value)))}</pubDate> 
    28             </py:when> 
    2927            <py:when test="col == 'summary'"> 
    3028              <title>#$row.id: $cell.value</title> 
    3129            </py:when> 
     
    3533          </py:choose> 
    3634        </py:with> 
    3735      </py:for> 
     36      <py:with vars="lru = max([int(cell.value) for cell in [c for cell_group in row.cell_groups for c in cell_group]  
     37                     if cell.header.col.strip('_') in ('time', 'changetime', 'created', 'modified')])"> 
     38          <pubDate>${http_date(fromtimestamp(lru))}</pubDate> 
     39      </py:with> 
    3840      <link py:if="row.id">${abs_url_of(row.resource)}</link> 
    3941      <guid isPermaLink="false" py:if="row.id">${abs_url_of(row.resource)}</guid> 
    4042      <category>Report</category>