Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
In version 7 I had a piece of code that created a new DataTypeDefinition, but I am not being able to find it's counterpart in version 8, any suggestions?
And the IDataTypeService doesn't have a GetDataTypeDefinitionByPropertyEditorAlias method anymore either
DataTypeDefinition dataType = null;
dataType = new DataTypeDefinition(containerId, alias);
dataType = _dataTypeService.GetDataTypeDefinitionByPropertyEditorAlias(alias).First() as DataTypeDefinition;
dataType.Name = name;
dataType.PropertyEditorAlias = propertiEditor;
I think the method has been renamed to GetByEditorAlias(alias) in V8
Can you try if that works for you ?
Yes Dave, GetByEditorAlias has worked. Thank you!
But I still haven't found a substitute for DataTypeDefinition , any suggestions?
This method now returns a type of IDataType : https://github.com/umbraco/Umbraco-CMS/blob/853087a75044b814df458457dc9a1f778cc89749/src/Umbraco.Core/Models/IDataType.cs
I think that has replaced DataTypeDefinition.
I have been fiddling with the code and search for a way around this. Let me share the background of what my code used to do in version 7, and you can tell me if what has changed in version 8:
The code was creating a new DateType so it could be consumed by the PropertyEditor.
It seems that no longer applies. What should I do? When I create the DataEditor class (with correct attributes), will it create the DataType automatically?
I haven't done that much with V8 yet. But I guess you need to use the save method of the datatype service
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted