I'm not sure if this is actually a breaking change from a more recent release, but it appears that DynamicNode returns a string with node Id instead of an int of node Id when invoked dynamically.
This breaks anywhere where we've used type casting to move out of DLR.
Has anybody experienced this? Is this a 4.7.1 to 4.7.2 issue?
As nobody's commented on this yet I'll add a bit more context for the google searchers.
The problem presents itself when you attempt to cast what was previously a dynamically returned int back into a non-dynamic int. The error you'll see on your website looks like this;
Error loading Razor Script Cannot convert type 'string' to 'int'
This error message won't be limited to the problem in this thread, but in this case, the problem can be fixed by looking for the following pattern, and resolving it. The 'LatestNewsNode' generic property is a 'Content Picker':
Breaking Change in DynamicNode?
I'm not sure if this is actually a breaking change from a more recent release, but it appears that DynamicNode returns a string with node Id instead of an int of node Id when invoked dynamically.
This breaks anywhere where we've used type casting to move out of DLR.
Has anybody experienced this? Is this a 4.7.1 to 4.7.2 issue?
EDIT: This is when accessing a content picker value
As nobody's commented on this yet I'll add a bit more context for the google searchers.
The problem presents itself when you attempt to cast what was previously a dynamically returned int back into a non-dynamic int. The error you'll see on your website looks like this;
Error loading Razor Script
Cannot convert type 'string' to 'int'
This error message won't be limited to the problem in this thread, but in this case, the problem can be fixed by looking for the following pattern, and resolving it. The 'LatestNewsNode' generic property is a 'Content Picker':
new DynamicNode((int)Model.LatestNewsNode)
To correct, change to:
new DynamicNode((string)Model.LatestNewsNode)
This change was made between 4.7.1 and 4.7.1.1. You can fix it for the content picker by going to umbracoSettings.Config and add this:
Than the content picker will be an int again.
Jeroen
is working on a reply...