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
I'm currently in the process of migrating a project from Umbraco v7 to v8.
I'm fairly new to C# so please forgive me if I've missed something very simple!
I've made an attempt to migrate the code - specifically this var from Umbraco v7:
var configNodeId = CurrentPage.GetPropertyValue<int?>("configurationNode", true);
...replacing the recursive functionality with new fallback option (change below).
There are no console errors on build throughout my solution but I believe this migrated code isn't functioning how it was in v7.
Any thoughts or help would be much appreciated!
namespace PNGBaseUmbracoWebsite.Controllers { public partial class BaseSurfaceController : SurfaceController { public new IPublishedContent CurrentPage { get { return base.CurrentPage; } } public IPublishedContent ConfigNode { get { // Umbraco 7 // var configNodeId = CurrentPage.GetPropertyValue<int?>("configurationNode", true); // Umbraco 8 var configNodeId = CurrentPage.Value<int?>("configurationNode", fallback: Fallback.To(Fallback.Ancestors, Fallback.DefaultValue), defaultValue: null); if (configNodeId != null) { configNode = Umbraco.Content(configNodeId); } } } }
Here is the difference I found in the Console while debugging
Umbraco 7 Umbraco 8 Does this explain why I may be having differences in values (displaying as null in v8) further down the pipeline?
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
Migrating controller code to v8 - code does not seem to be working as expecting
I'm currently in the process of migrating a project from Umbraco v7 to v8.
I'm fairly new to C# so please forgive me if I've missed something very simple!
I've made an attempt to migrate the code - specifically this var from Umbraco v7:
...replacing the recursive functionality with new fallback option (change below).
There are no console errors on build throughout my solution but I believe this migrated code isn't functioning how it was in v7.
Any thoughts or help would be much appreciated!
Here is the difference I found in the Console while debugging
Umbraco 7
Umbraco 8
Does this explain why I may be having differences in values (displaying as null in v8) further down the pipeline?
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.