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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user