Description

The RecentChanges RSS feed ignores the url_mappings setting.

Steps to reproduce

  1. add something to url_mappings
  2. check the RC rss feed to see that the mapping isn't applied

Example

I fixed my wikis so I don't know of one that exhibits the bug currently.

Details

MoinMoin Version

patch-841

OS and Version

debian/stable

Python Version

2.3

Server Setup

twisted

Server Details

?

Workaround

None known.

Fix

This patch sprinkles mapURL into the rss generation code. I'm not sure I got all instances though.

--- orig/MoinMoin/action/rss_rc.py
+++ mod/MoinMoin/action/rss_rc.py
@@ -96,7 +96,7 @@
         (handler.xmlns['rdf'], 'about'): request.getBaseURL(),
         })
     handler.simpleNode('title', cfg.sitename)
-    handler.simpleNode('link', interwiki + wikiutil.quoteWikinameURL(pagename))
+    handler.simpleNode('link', wikiutil.mapURL(request, interwiki + wikiutil.quoteWikinameURL(pagename)))
     handler.simpleNode('description', 'RecentChanges at %s' % cfg.sitename)
     if logo:
         handler.simpleNode('image', None, {
@@ -110,6 +110,7 @@
     for item in logdata:
         link = "%s%s#%04d%02d%02d%02d%02d%02d" % ((interwiki,
                 wikiutil.quoteWikinameURL(item.pagename),) + item.time[:6])
+        link = wikiutil.mapURL(request, link)
         handler.simpleNode(('rdf', 'li'), None, attr={
             (handler.xmlns['rdf'], 'resource'): link,
         })
@@ -123,14 +124,14 @@
             (handler.xmlns['rdf'], 'about'): logo,
             })
         handler.simpleNode('title', cfg.sitename)
-        handler.simpleNode('link', interwiki)
+        handler.simpleNode('link', wikiutil.mapURL(request, interwiki))
         handler.simpleNode('url', logo)
         handler.endNode('image')
 
     # emit items
     for item in logdata:
         page = Page(request, item.pagename)
-        link = interwiki + wikiutil.quoteWikinameURL(item.pagename)
+        link = wikiutil.mapURL(request, interwiki + wikiutil.quoteWikinameURL(item.pagename))
         rdflink = "%s#%04d%02d%02d%02d%02d%02d" % ((link,) + item.time[:6])
         handler.startNode('item', attr={
             (handler.xmlns['rdf'], 'about'): rdflink,

Discussion

This patch is wrong. url mapping should be done one place. Why this code does not use request.getQualifiedURL() which is responsible for url mapping?

And url mapping is not needed at all with current dev code that work transparently behind a proxy.


Have had the same problem.
I changed the variable "interwiki" to the wiki base url (line 54 of /usr/local/lib/python2.3/site-packages/MoinMoin/action/rss_rc.py ):
interwiki = 'http://wiki.mydomain.org/'
(Before this, the rss resource attribute (of rdf:li tag) pointed to 'http://localhost:8080' )

Though this won't work, with a wikifarm...


Plan


CategoryMoinMoinBugConfirmed

MoinMoin: MoinMoinBugs/RSSFeedIgnoresUrlMappings (last edited 2007-10-29 19:06:00 by localhost)