Description

RSS feed does not show a diff for a new page.

Steps to reproduce

  1. Configure your RSS reader to get diffs: http://moinmoin.wikiwikiweb.de/RecentChanges?action=rss_rc&diffs=1&unique=0

  2. Create a new page, for example a new bug page
  3. The feed does not contain a diff for the new page, like the one that shows on an email notification.

Example

<item rdf:about="http://moinmoin.wikiwikiweb.de/MoinMoinBugs/RSS_does_not_validate#20051120143312"><title>MoinMoinBugs/RSS does not validate</title><link>http://moinmoin.wikiwikiweb.de/MoinMoinBugs/RSS_does_not_validate</link><dc:date>2005-11-20T14:33:12Z</dc:date><dc:contributor><rdf:Description wiki:host="line134-51.adsl.actcom.co.il"><rdf:value>Self:NirSoffer</rdf:value></rdf:Description></dc:contributor><wiki:version>1132497192000000</wiki:version><wiki:status>updated</wiki:status><wiki:diff>http://moinmoin.wikiwikiweb.de/MoinMoinBugs/RSS_does_not_validate?action=diff</wiki:diff><wiki:history>http://moinmoin.wikiwikiweb.de/MoinMoinBugs/RSS_does_not_validate?action=info</wiki:history></item>

Details

This wiki.

Workaround

Here's a patch to action/rss_rc.py that adds the page content if there is no revision to diff to:

                         if len(lines) > 20:
                             lines = lines[:20] + ['...\n']
                         lines = '\n'.join(lines)
-                        lines = wikiutil.escape(lines)
-                        desc_text = '%s\n<pre>\n%s\n</pre>\n' % (desc_text, lines)
+                    else:
+                        lines = page.get_raw_body()
+                    lines = wikiutil.escape(lines)
+                    desc_text = '%s\n<pre>\n%s\n</pre>\n' % (desc_text, lines)
                     break
         if desc_text:
             handler.simpleNode('description', desc_text)

There's still a bug: lines = page.get_raw_body() gives the latest revision instead of rev. This is incorrect if there have been more recent changes too. --TuukkaHastrup

Discussion

Plan


CategoryMoinMoinBug

MoinMoin: MoinMoinBugs/RSS does not show diff for new page (last edited 2007-10-29 19:08:09 by localhost)