From 8eb478697613595f80709287c4a38124b2bbd3ed Mon Sep 17 00:00:00 2001 From: kjac Date: Fri, 26 Jun 2015 14:08:00 +0200 Subject: [PATCH] Revert API method GetByGuid() to its previous state All default prevalue enrichment is now handled by the API method GetAllPropertyEditors() --- .../Api/ArchetypeDataTypeController.cs | 25 +------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/app/Umbraco/Umbraco.Archetype/Api/ArchetypeDataTypeController.cs b/app/Umbraco/Umbraco.Archetype/Api/ArchetypeDataTypeController.cs index 2d0159f..beb591c 100644 --- a/app/Umbraco/Umbraco.Archetype/Api/ArchetypeDataTypeController.cs +++ b/app/Umbraco/Umbraco.Archetype/Api/ArchetypeDataTypeController.cs @@ -40,30 +40,7 @@ namespace Archetype.Api } var dataTypeDisplay = Mapper.Map(dataType); - - // enrich the prevalues with any missing default prevalues for the datatype (e.g. image cropper "focalPoint# prevalue) - var preValues = dataTypeDisplay.PreValues.ToList(); - if(string.IsNullOrEmpty(dataType.PropertyEditorAlias) == false) - { - // fetch the default prevalues for the datatype - var propEditor = PropertyEditorResolver.Current.GetByAlias(dataType.PropertyEditorAlias); - if(propEditor != null && propEditor.DefaultPreValues != null && propEditor.DefaultPreValues.Any()) - { - // add any missing prevalues - foreach(var missingPreValue in propEditor.DefaultPreValues.Where(p => preValues.Any(pre => pre.Key == p.Key) == false)) - { - var value = missingPreValue.Value; - // if the prevalue is a JSON object, deserialize it - if(value != null && value.ToString().DetectIsJson()) - { - value = JsonConvert.DeserializeObject(value.ToString()); - } - preValues.Add(new PreValueFieldDisplay { Key = missingPreValue.Key, Value = value }); - } - } - } - - return new { selectedEditor = dataTypeDisplay.SelectedEditor, preValues = preValues }; + return new { selectedEditor = dataTypeDisplay.SelectedEditor, preValues = dataTypeDisplay.PreValues }; } public object GetByGuid(Guid guid, string contentTypeAlias, string propertyTypeAlias, string archetypeAlias, int nodeId)