Description

The locations generated by the action sitemap.py contain the scriptname twice and point therefore to nonexistent locations if the scriptname is not empty.

Steps to reproduce

1. Create a wiki which is not located at the / of your webserver.

2. Fetch a sitemap from the wiki (located at http://example.tld/mywiki/)

3. the entries will look this:

Example

/!\ This is not my page, so be gentle.

http://wiki.xensource.com/xenwiki/FrontPage ? action=sitemap (unknown MoinMoin version)
http://en.wiki.mesemb.ru/wiki/FrontPage ? action=sitemap (MoinMoin 1.7.2; now works as IvanBoldyrev applied a patch)

Component selection

Details

MoinMoin Version

Version 1.5.8 [Revision release]

See

The <loc> field gets written by the following code (line-numbers according to this version):

19  def make_url_xml(vars):
20    """ assemble a single <url> xml fragment """
21    return """\
22    <url>
23    <loc>%(base)s%(url)s</loc>
24    <lastmod>%(lastmod)s</lastmod>
25    <changefreq>%(changefreq)s</changefreq>
26    <priority>%(priority)s</priority>
27    </url>
28    """ % vars

where

30  def sitemap_url(request, base, page):
32    url = page.url(request)

and

62  def execute(pagename, request):
66    base = request.getBaseURL()

Both page.url() and request.getBaseURL return the scriptname (as documented in their docstrings), which explains the double scriptname "mywiki/mywiki".

Workaround

See changeset with fix below.

Discussion

I changed status from Fixed to not-fixed because this bug is reproducible in MM 1.7.2 and I see no traces of patch mentioned below in released sources. -- IvanBoldyrev 2008-09-20 17:51:34

Plan


CategoryMoinMoinBugFixed

MoinMoin: MoinMoinBugs/DoubleScriptNameInSitemap (last edited 2008-09-21 16:13:03 by IvanBoldyrev)