Got Data Type Creation working. Need to look at fixing up the issues with creating content/media tomorrow.

This commit is contained in:
Shannon
2013-08-20 18:10:19 +10:00
parent b901ae3269
commit 7df641cf2b
11 changed files with 57 additions and 29 deletions

View File

@@ -22,17 +22,26 @@ namespace Umbraco.Web.Models.Mapping
protected override IEnumerable<PreValueFieldDisplay> ResolveCore(IDataTypeDefinition source)
{
var propEd = PropertyEditorResolver.Current.GetById(source.ControlId);
if (propEd == null)
PropertyEditor propEd = null;
if (source.ControlId != Guid.Empty)
{
throw new InvalidOperationException("Could not find property editor with id " + source.ControlId);
propEd = PropertyEditorResolver.Current.GetById(source.ControlId);
if (propEd == null)
{
throw new InvalidOperationException("Could not find property editor with id " + source.ControlId);
}
}
var dataTypeService = (DataTypeService) _dataTypeService.Value;
var preVals = dataTypeService.GetPreValuesCollectionByDataTypeId(source.Id);
var dictionaryVals = PreValueCollection.AsDictionary(preVals);
var result = propEd.PreValueEditor.Fields.Select(Mapper.Map<PreValueFieldDisplay>).ToArray();
var result = Enumerable.Empty<PreValueFieldDisplay>();
if (propEd != null)
{
result = propEd.PreValueEditor.Fields.Select(Mapper.Map<PreValueFieldDisplay>).ToArray();
}
var currentIndex = 0; //used if the collection is non-dictionary based.
foreach (var field in result)
{