Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi,
Does anyone know if the Umbraco.Coalesce function is ported from previous versions of Umbraco? Namely v7.
It seems to me that the Html.Coalesce in v10 does not work as Umbraco.Coalesce did in v7. It returns strings instead of objects.
Maybe there is something I am missing?
Thanks.
Hi Scott
Just looking at the V7 implementation to see if I could spot what had changed:
https://github.com/umbraco/Umbraco-CMS/blob/v7/dev/src/Umbraco.Web/UmbracoHelper.cs#L1438
and seems to call Coalesce on a HtmlStringUtilities class:
public string Coalesce(params object[] args) { return _stringUtilities.Coalesce<DynamicNull>(args); }
(but seems to return string?)
Looking in VLatest on the HtmlHelper
https://github.com/umbraco/Umbraco-CMS/blob/62b49c7ea7cc61e3eba1f1fb03dd52985c886a29/src/Umbraco.Web.Website/Extensions/HtmlHelperRenderExtensions.cs#L978
public static string Coalesce(this IHtmlHelper helper, params object?[] args) => s_stringUtilities.Coalesce(args);
That seems to also return a string and call stringUtilities, compare the implementation of StringUtilities Coalesque then!
V7: https://github.com/umbraco/Umbraco-CMS/blob/v7/dev/src/Umbraco.Web/HtmlStringUtilities.cs#L80
VLatest: https://github.com/umbraco/Umbraco-CMS/blob/33adbf41fa1f5c5d0759c70a7116114107addf56/src/Umbraco.Web.Common/Mvc/HtmlStringUtilities.cs#L94
And they seem to be implemented differently! so could explain the difference you are seeing,but I think both are returning strings???
regards
Marc
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Umbraco.Coalesce
Hi,
Does anyone know if the Umbraco.Coalesce function is ported from previous versions of Umbraco? Namely v7.
It seems to me that the Html.Coalesce in v10 does not work as Umbraco.Coalesce did in v7. It returns strings instead of objects.
Maybe there is something I am missing?
Thanks.
Hi Scott
Just looking at the V7 implementation to see if I could spot what had changed:
https://github.com/umbraco/Umbraco-CMS/blob/v7/dev/src/Umbraco.Web/UmbracoHelper.cs#L1438
and seems to call Coalesce on a HtmlStringUtilities class:
(but seems to return string?)
Looking in VLatest on the HtmlHelper
https://github.com/umbraco/Umbraco-CMS/blob/62b49c7ea7cc61e3eba1f1fb03dd52985c886a29/src/Umbraco.Web.Website/Extensions/HtmlHelperRenderExtensions.cs#L978
That seems to also return a string and call stringUtilities, compare the implementation of StringUtilities Coalesque then!
V7: https://github.com/umbraco/Umbraco-CMS/blob/v7/dev/src/Umbraco.Web/HtmlStringUtilities.cs#L80
VLatest: https://github.com/umbraco/Umbraco-CMS/blob/33adbf41fa1f5c5d0759c70a7116114107addf56/src/Umbraco.Web.Common/Mvc/HtmlStringUtilities.cs#L94
And they seem to be implemented differently! so could explain the difference you are seeing,but I think both are returning strings???
regards
Marc
is working on a reply...