Updates new UDI pickers that have start nodes for pre-values to also store UDIs for their prevalues, this has a knock on effect in that we need to be able to inject some server side config for pre-value editors (otherwise we'd have to make diff udi prevalue editors but that isn't very re-usable), so have implemented that and then updated all of the logic to deal with the udi idType.

This commit is contained in:
Shannon
2017-02-08 16:15:27 +11:00
parent 846ac573cc
commit a20cc60c10
14 changed files with 274 additions and 72 deletions

View File

@@ -300,24 +300,31 @@ namespace Umbraco.Web.Trees
}
/// <summary>
/// Get an entity via an id that can be either an integer or a Guid
/// Get an entity via an id that can be either an integer, Guid or UDI
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
internal IUmbracoEntity GetEntityFromId(string id)
{
IUmbracoEntity entity;
Guid idGuid = Guid.Empty;
int idInt;
Udi idUdi;
if (Guid.TryParse(id, out idGuid))
{
entity = Services.EntityService.GetByKey(idGuid, UmbracoObjectType);
}
else if (int.TryParse(id, out idInt))
{
entity = Services.EntityService.Get(idInt, UmbracoObjectType);
}
else if (Udi.TryParse(id, out idUdi))
{
var guidUdi = idUdi as GuidUdi;
entity = guidUdi != null ? Services.EntityService.GetByKey(guidUdi.Guid, UmbracoObjectType) : null;
}
else
{
return null;