Ive removed en-US and set en-GB as the default language
Ive created 1 node at the root of the tree with 2 child nodes, all in en-GB and published.
I then use the code below to get the root (called from a UmbracoPageController):
using (var umbracoContextReference = _umbracoContextFactory.EnsureUmbracoContext())
{
var root = umbracoContextReference.UmbracoContext.Content.GetByRoute("/", false, "en-GB");
}
That works, and returns the root IPublishedContent.
But this is where things get strange.
root.Children has no results
root.ChildrenForAllCultures has the two en-GB children
Then.... If the doc type for the root node is "Site" which has a content picker property called "Error404Page" (VaryByCulture enabled), if i do :
var siteRoot = new Site(root, _publishedValueFallback)
This works to map to the concreate class, but accessing siteRoot.Error404Page throws an exception in Umbraco "Value cannot be null. (Parameter 'key1')"
I can also confirm i get the same issue if i remove all the languages except the default en-GB, only now, siteRoot.Error404Page is null and not throwing an exception.
I can also confirm that if i turn off "VaryByCulture" on the Error404Page property, it works fine.
Im stumped. Is this a bug in U10 or am i doing something stupid ?
U10 - rc5 - Multi-culture site oddities (bug?)
Hey,
I have a vanilla U10 site.
Ive added en-GB & de-DE.
Ive removed en-US and set en-GB as the default language
Ive created 1 node at the root of the tree with 2 child nodes, all in en-GB and published.
I then use the code below to get the root (called from a UmbracoPageController):
That works, and returns the root IPublishedContent.
But this is where things get strange.
root.Children has no results
root.ChildrenForAllCultures has the two en-GB children
Then.... If the doc type for the root node is "Site" which has a content picker property called "Error404Page" (VaryByCulture enabled), if i do :
This works to map to the concreate class, but accessing siteRoot.Error404Page throws an exception in Umbraco "Value cannot be null. (Parameter 'key1')"
I can also confirm i get the same issue if i remove all the languages except the default en-GB, only now, siteRoot.Error404Page is null and not throwing an exception.
I can also confirm that if i turn off "VaryByCulture" on the Error404Page property, it works fine.
Im stumped. Is this a bug in U10 or am i doing something stupid ?
is working on a reply...