From f941e9caca1a1f2d3f2257dfd913ff3a563b1f10 Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Wed, 8 Sep 2021 14:59:52 +0200 Subject: [PATCH] Fixed issue because of missing overload of GetAncestors that takes an Guid as id. --- .../Controllers/EntityController.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/Umbraco.Web.BackOffice/Controllers/EntityController.cs b/src/Umbraco.Web.BackOffice/Controllers/EntityController.cs index afe154ca48..944f1946bf 100644 --- a/src/Umbraco.Web.BackOffice/Controllers/EntityController.cs +++ b/src/Umbraco.Web.BackOffice/Controllers/EntityController.cs @@ -41,6 +41,7 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers /// Some objects such as macros are not based on CMSNode /// [PluginController(Constants.Web.Mvc.BackOfficeApiArea)] + [ParameterSwapControllerActionSelector(nameof(GetAncestors), "id", typeof(int), typeof(Guid))] [ParameterSwapControllerActionSelector(nameof(GetPagedChildren), "id", typeof(int), typeof(string))] [ParameterSwapControllerActionSelector(nameof(GetPath), "id", typeof(int), typeof(Guid), typeof(Udi))] [ParameterSwapControllerActionSelector(nameof(GetUrlAndAnchors), "id", typeof(int), typeof(Guid), typeof(Udi))] @@ -804,6 +805,17 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers return GetResultForAncestors(id, type, queryStrings); } + public ActionResult> GetAncestors(Guid id, UmbracoEntityTypes type, [ModelBinder(typeof(HttpQueryStringModelBinder))]FormCollection queryStrings) + { + var entity = _entityService.Get(id); + if (entity is null) + { + return NotFound(); + } + + return Ok(GetResultForAncestors(entity.Id, type, queryStrings)); + } + /// /// Searches for results based on the entity type ///