The call to DisposableTimer.DebugDuration() in
ArchetypeValueConverter.ConvertDataToSource() expects the propertyType
parameter to be not null, but the implementation of
ArchetypeValueConverter.ConvertDataToSource() allows the propertyType
parameter to be null. This breaks some of the unit tests.
I've added a null check in the call to DisposableTimer.DebugDuration()
to counter this issue.
* Add new property HostContentType to make Properties aware of their content type
* Adjust Dummy PropertyType to include the Content Type
* Pass in Content Type from ValueConverter to Deserialization helper through new optional parameter
* Populate the property's HostContentType via RetrieveAdditionalProperties
* Make sure HostContentType isn't persisted
Notes: In some cases, the Umbraco Core looks for pt.ContentType.Alias, which didn't exist previously in our Dummy PropertyType. This would also potentially cause an error if any PVC's do the same.
To fix we now keep track of the Content Type that the Archetype exists on (determined in the ArchetypeValueConverter), and pass this along to our Dummy PropertyType (and thus to PVCs)
Note we made the hostContentType an optional parameter as there's some cases where we won't know the content type (ie ConvertDbToEditor). This (shouldn't?) be an issue as these cases should never have a reason to call GetValue.
Fix issue #123. Explicitly call $setDirty() on the PE form when
reordering or removing rows, thus ensuring the editor will be prompted
to discard changes if navigating away before saving.
By calling ngModelCtrl.$setViewValue() only when there's actually a
change in the value, we keep Umbraco from prompting to discard changes
immediately after all changes have been saved (see issue #121 for more
details).
Use the built-in dirty state to handle row changes instead of the custom
state variable introduced in the previous commit.
Additionally this solves issue #123 by setting the dirty state when rows
are removed or sorted.