tsangktsangk 06 Jan 2013 09:19

Around 2 months ago, Wikidot changed the way it processed and parsed data forms. A bug report was posted by RobElliottRobElliott, and there has been no official blog post made about it yet. But in short, old [[form]] that weren't 100% YAML compliant will not save now due to a change in the library that Wikidot uses to parse form blocks. The next couple of paragraphs explains the change, however, you can skip to the "fix" by clicking here.

Explanation

As most of the people who use data forms know, Wikidot employs the YAML within the [[form]] syntax.

Previously, a forgiving parser (namely SPYC) was used to parse and extract these values. Forgiving means that tiny mistakes in the markup are still interpreted "correctly". However, due to the amount of errors that this code has supposedly created on the servers1, Wikidot has now forced YAML validation using the sfYAML library whenever [[form]] blocks are saved. That means all form blocks need to be 100% valid when on save (this, however, excludes the API's pages.save_one).

Fixing it

I have devised a simple converter script that converts the now forgiving YAML format to the new stricter sfYAML parser. You can find it at:

convert.wikidot.com

All you have to do is copy and paste the *entire* _template file with the [[form]] blocks included and the converter will spew out a fixed version of the YAML code.

Also, if you need help finding all your data form templates in your site, James KanjoJames Kanjo write an impressive piece of code that lists all pages with [[form]] blocks! Check it out here.


Recommend this post?

rating: +4+x

What do you think? Give us your thoughts!

Add a New Comment