Upgrade to 7.6.1 error loading macro partials using Content.Url
Hello,
I'm in the process of upgrading our website to Umbraco v7.6.1 via NuGet package. The upgrade worked, but I get runtime errors on pages that use macro partials where I'm using code to access the Umbraco content API to return data. Any help is greatly appreciated.
Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: 'System.Array' does not contain a definition for 'Url'
I adjusted the code to use @item.linkUrl.Url wherever I'm getting Umbraco content. Do you recommend code rewrite or disabling Property Value Converters?
Upgrade to 7.6.1 error loading macro partials using Content.Url
Hello,
I'm in the process of upgrading our website to Umbraco v7.6.1 via NuGet package. The upgrade worked, but I get runtime errors on pages that use macro partials where I'm using code to access the Umbraco content API to return data. Any help is greatly appreciated.
@foreach (var item in selection) { <div class="col-sm-4 loan-option"> <section class="item-img-wrap"> <a href="@Umbraco.Content(item.linkUrl).Url" class="item-img" style="background-image: url(https://assets.newamericanfunding.com@(Umbraco.Media(item.backgroundImage).Url))"></a> </section> <section class="option-wrap @item.name.Replace(" ", "-").ToLower()"> <div> <h3 class="item-title"><a href="@Umbraco.Content(item.linkUrl).Url">@Html.Raw(item.itemTitle)</a></h3> <h4 class="item-desc">@item.itemDescription</h4> </div> </section> </div> }
Hi Jason
Problem can be with Property Value Converters, please have a look:
https://our.umbraco.org/documentation/getting-started/setup/upgrading/760-breaking-changes#property-value-converters-u4-7318
Please, disable Property Value Converters or just rewrite your code, I think it should be :
Thanks,
Alex
Thank you, Alex!
I adjusted the code to use
@item.linkUrl.Url
wherever I'm getting Umbraco content. Do you recommend code rewrite or disabling Property Value Converters?Jason
I recommend code rewrite, Property Value Converters is an awesome feature of Umbraco.
Thanks,
Alex
Okay cool. Thank you for your time!
Jason
You are welcome, Jason.
Alex
is working on a reply...