Description

Pages containing REDIRECTs are empty (no content) in the dump.

Steps to reproduce

  1. Make a dump of a page which is just a REDIRECT to another one:
    • moin.py --config-dir=<..> export dump --target=<..> --wiki-url=<..> --page=MyRedirectedPage

  2. Check that the generated HTML page has no contents.

Example

Component selection

Details

MoinMoin Version

1.9.3

OS and Version

GNU/Linux with Kernel 2.6.x

Python Version

2.6.5

Server Setup

Server Details

Language you are using the wiki in (set in the browser/UserPreferences)

Workaround

This patch puts a link to the redirection target in the HTML dump of the redirected page:

   1 diff -u MoinMoin/script/export/dump.py.~1~ MoinMoin/script/export/dump.py
   2 --- MoinMoin/script/export/dump.py.~1~
   3 +++ MoinMoin/script/export/dump.py
   4 @@ -194,9 +194,15 @@
   5                  request.url = urlbase + pagename # add current pagename to url base
   6                  page = Page.Page(request, pagename)
   7                  request.page = page
   8 +                pi = page.pi
   9 +
  10                  try:
  11                      request.reset()
  12 -                    pagehtml = request.redirectedOutput(page.send_page, count_hit=0, content_only=1)
  13 +                    if 'redirect' in pi:
  14 +                        target = pi['redirect']
  15 +                        pagehtml = '-> <a href="%s">%s</a>' % (wikiutil.quoteWikinameURL(target), wikiutil.escape(target))
  16 +                    else:
  17 +                        pagehtml = request.redirectedOutput(page.send_page, count_hit=0, content_only=1)
  18                  except:
  19                      errcnt = errcnt + 1
  20                      print >> sys.stderr, "*** Caught exception while writing page!"
  21 
  22 Diff finished.  Thu Jul 08 09:07:50 2010

Discussion

Plan


CategoryMoinMoinBug CategoryMoinMoinPatch

MoinMoin: MoinMoinBugs/ExportDumpAndRedirects (last edited 2010-07-08 08:13:34 by EmilioLopes)