I find your package very useful and I used it with almost all my apps, but I had an issue using it with umbraco cloud (v7).
I noticed that in the json stored in the db there's a property called "dataTypeId", used to retrieve the configuration of the umbraco's datatype.
I don't know if it's normal behaviour, but the ids of the datatypes are different between each environments on the cloud, the guids are the same instead.
So I played a bit with the source code and I've added another prop "dataTypeGuid", used to retrieve the datatype information instead of the "dataTypeId"
It's a fix, but it seems work well for now.
FILE: SectionApiController.cs
Add a new method "AddGuidToObject"
private void AddGuidToObject(JObject data)
{
if (data != null)
{
JToken groups;
if (data.TryGetValue("groups", out groups))
{
foreach (var group in groups)
{
var properties = group.Value<JArray>("properties");
if (properties != null)
{
foreach (var property in properties)
{
var dataTypeDefinition =
Services.DataTypeService.GetDataTypeDefinitionById(property.Value<int>("dataTypeId"));
property["dataTypeGuid"] = dataTypeDefinition.Key;
}
}
}
}
}
}
Edit the foreach inside the "AddSomeProperiesToObject"
Working on Umbraco Cloud
Hi!
I find your package very useful and I used it with almost all my apps, but I had an issue using it with umbraco cloud (v7).
I noticed that in the json stored in the db there's a property called "dataTypeId", used to retrieve the configuration of the umbraco's datatype.
I don't know if it's normal behaviour, but the ids of the datatypes are different between each environments on the cloud, the guids are the same instead.
So I played a bit with the source code and I've added another prop "dataTypeGuid", used to retrieve the datatype information instead of the "dataTypeId"
It's a fix, but it seems work well for now.
FILE: SectionApiController.cs
Add a new method "AddGuidToObject"
Edit the foreach inside the "AddSomeProperiesToObject"
Call the "AddGuidToObject" inside the "SaveData"
Thank you for your work, I hope my suggestion can be useful :D
S
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.