Don't worry about it - I understand why you need beautification - it was my natural desire as well, but my use for the templates was mostly from parsing existing ones and reading/writing parameters withing them and not so much new templates or new parameters so I never really thought about simplifying that process.


On Tue, Jun 29, 2010 at 3:49 PM, Jeroen De Dauw <> wrote:

I see you reverted it, so it's no longer an issue I guess. I did notice this change was breaking things, and made a fix for it that caused the spaces and new lines to be only inserted when creating a template from scratch. Apparently I never committed this though, and I don't have the code any more :(


Jeroen De Dauw
Don't panic. Don't be evil. 50 72 6F 67 72 61 6D 6D 69 6E 67 20 34 20 6C 69 66 65!

On 29 June 2010 21:34, Sergey Chernyshev <> wrote:
Hey Jeroen,

Some user contacted me regarding problems with POM and I noticed that you made a breaking change to TemplateParameter.php

It's fine with me - you guys are active on the project, but just wanted to give you heads up about test framework I'm using for it.

Essentially, you can run "make test" in the folder and it will run all the tests that can be found in /tests/ folder:

I reverted the change to make tests pass and checked the code in, but wanted to help out with properly addressing the issue you were having.

What you did was actually achieving a cosmetic fix to the output, but in the wrong way - POM is coded in the way that it preserves original formatting and your change was forcing additional space around the = sign and '\n' (probably a typo) after the line.

It's a good idea to have that code beautifying functionality there, but it is probably better to insert it on the template level and only when template is created from scratch, but preserve current behavior for existing templates.

In any case, I recommend you accompany the code with the tests because it's very easy to break the parser, but tests help you find problems right away.

BTW, it's probably a good idea to land this extension community on some mailing list so others can benefit too - wikitech might be a good place instead of SMW because POM is quite generic.

Thank you,


Sergey Chernyshev