Skip to content
This repository has been archived by the owner on Mar 7, 2019. It is now read-only.

Commit

Permalink
Merge branch 'master' into fix-194-again
Browse files Browse the repository at this point in the history
  • Loading branch information
Kenn Jacobsen committed Oct 2, 2015
2 parents 3904b65 + d5fd59b commit bc19e6d
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions app/Umbraco/Umbraco.Archetype/Models/ArchetypeModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,9 @@ IEnumerator IEnumerable.GetEnumerator()

public string SerializeForPersistence()
{
// clear the editor state before serializing (it's temporary state data)
foreach(var property in Fieldsets.SelectMany(f => f.Properties.Where(p => p.EditorState != null)).ToList())
{
property.EditorState = null;
}

var json = JObject.Parse(JsonConvert.SerializeObject(this, new JsonSerializerSettings() { ReferenceLoopHandling = ReferenceLoopHandling.Ignore }));

var propertiesToRemove = new String[] { "propertyEditorAlias", "dataTypeId", "dataTypeGuid", "hostContentType" };
var propertiesToRemove = new String[] { "propertyEditorAlias", "dataTypeId", "dataTypeGuid", "hostContentType", "editorState" };

json.Descendants().OfType<JProperty>()
.Where(p => propertiesToRemove.Contains(p.Name))
Expand Down

0 comments on commit bc19e6d

Please sign in to comment.