From 9a8f71dd8196a32ba453d96ccce5c83efb10d9e2 Mon Sep 17 00:00:00 2001 From: Dan Booth Date: Fri, 11 May 2018 14:53:03 +0100 Subject: [PATCH] Fixed issue where TypedMedia didn't work with UDI strings --- src/Umbraco.Web/UmbracoHelper.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web/UmbracoHelper.cs b/src/Umbraco.Web/UmbracoHelper.cs index 6ae449a584..75fba514cc 100644 --- a/src/Umbraco.Web/UmbracoHelper.cs +++ b/src/Umbraco.Web/UmbracoHelper.cs @@ -1033,10 +1033,14 @@ namespace Umbraco.Web return ContentQuery.TypedMedia(id); } + /// + /// Returns typed Media content based on an Identifier + /// + /// The id - this can be the numeric Id such as '1234' or a UDI string such as 'umb://media/a1276990a50e4784b25458fc8d0c487c' + /// PublishedContent if a corresponding media Id exists; otherwise null public IPublishedContent TypedMedia(string id) { - int intId; - return ConvertIdObjectToInt(id, out intId) ? ContentQuery.TypedMedia(intId) : null; + return TypedMediaForObject(id); } ///