imulus/Archetype — pull request #129 by kjac (2014-05-14 10:20:21+00:00)
Title: Use the correct currentValue for ValueEditor conversion when saving

I know the serialization/deserialization of the Archetype value isn't exactly in need of additional complexity, but I'm afraid it needs to be done.

Right now the ArcheType ValueEditor simply passes the entered value as "current value" to the ValueEditors of the individual properties in a fieldset (https://github.com/imulus/Archetype/blob/master/app/Umbraco/Umbraco.Archetype/PropertyEditors/ArcheTypePropertyEditor.cs#L131 - ```propDef.Value``` is used for the ```currentValue``` parameter of the ```ConvertEditorToDb()``` method). It really should be passing the previous value of the property - the value that was last entered by the editor (if any).

For the time being, the current implementation works because the property editors of the contained properties do not care about the previously entered value. However, as soon as more complex property editors come into play, Archetype might be the cause of unforeseen problems. For argument's sake, imagine a property editor that sends emails when it detects a property value change - in the current implementation this property editor would never get to send an email, because there would never be a difference between the last entered value (```currentValue```) and the newlu entered value.

And yes, you guessed it: Fixing this issue is also the first step of the way to handling the Upload and ImageCropper data types, they need the previously selected image to clean up on disk.

Unfortunately this change requires the introduction of some means to positively identify a fieldset in an Archetype value. I've added a guid ```Id``` property to the fieldset model for this purpose, and for the time being this property is assigned a value for newly created fieldsets when the Archetype is saved. I'm not sure if it would be beneficial to perform this assignment on the client instead/also?