imulus/Archetype — pull request #137 by kjac (2014-05-22 17:38:52+00:00)
Title: Fix issue #131 - rewrite validation routines and fix nested Archetype validation

Please see issue #131 for a wall of text on the issue.

I've rewritten the validation to make it work with pristine Archetypes (newly created documents) and with nested Archetypes. In addition I've optimized the validation a little, so validation is now only performed on the PE that changes value, not on the entire fieldset.

I've also rewritten the fix from commit 4785c85 to work with validation - please check that it works as intended... I've explicitly put the Archetype error classes after the fieldset and property alias classes, I figure it'd make the most sense when writing custom CSS.

With regards to the wall of text on #131 I've chosen to persue the Umbraco way of validating things, meaning:
1. When the Archetype PE loads, it performs a "soft" validation of all contained PEs, preventing the form from submitting if they're invalid but not actually displaying the validation errors to the user.
2. When a contained PE changes value, a "soft" validation is performed on it.
3. Before submit, Archetype performs a "hard" validation of all contained PEs, this time displaying the validation errors to the user.

Bite me. Another wall of text. Sorry.