Description

When creating a homepage using HomepageTemplate, the automatic substitution for the user's name does not take place. Consequently, users will probably end up re-editing their page once they see that the heading is @``ME@ rather than a form of their name.

Steps to reproduce

  1. Create a new page, choosing HomepageTemplate as the basis of the page.

  2. Edit the page, but leave the heading unchanged.
  3. Save the page.

Example

Here's the offending markup:

== @``ME@ ==

Component selection

Details

MoinMoin Version

1.8.3

OS and Version

moinmo.in

Python Version

moinmo.in

Server Setup

moinmo.in

Server Details

moinmo.in

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

English (United Kingdom)

Workaround

Just change the new page so that the substitution can be made, using @ME@ in the heading.

Discussion

It looks like the substitution is deliberately blocked through the use of the additional characters: this would prevent the expansion happening when saving the template in MoinMoin itself, but then the extra characters never go away. So when the template is copied and edited, the characters remain and block further substitution attempts when really, the characters should be removed before the template is used.

Anywway we need the right page_template_regex on the master wikis to solve this. With the current one template pages only for english won't expand these variables by saving. -- ReimarBauer 2009-05-31 07:55:04

I've just changed the workaround so it doesn't substitute my name but instead shows the substitution variable that one would actually enter. I did actually dig around in the code and saw that substitution should not happen when saving template pages (there's a call to wikiutil.isTemplatePage(request, self.page_name) in MoinMoin.PageEditor.saveText, so it should have been possible to put the raw form of the variable rather than a protected form of it (which I've had to use above, too). -- PaulBoddie 2009-06-06 21:07:26

Maybe adding a specific header (##IsTemplate) could help with this. When this header is present, the document would be used as a template (no var instanciation). It should be simple enough to automatically remove it when the page is used to create a new document. -- -- JeanPhilippeGuérard 2010-07-25 16:33:42

Plan


CategoryMoinMoinBug

MoinMoin: MoinMoinBugs/HomepageTemplateUsesInvalidSubstitutionVariableName (last edited 2010-07-25 16:33:42 by JeanPhilippeGuérard)