You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you have this situation, some of the queries don't locate the from node. Here is the fix for that in case anyone else runs into this:
Inside ContextHelper.Cs, the EnsureCorrectCultur() method needs to build the xpath string using the constant as follows
var homeNode = helper.TypedContentAtXPath("//root//"+ AppConstants.DocTypeForumRoot).FirstOrDefault();
Inside Dialog.cs, the Settings() method at the bottom should read like this so that it also looks at all of the nodes in the root, and will choose the first one (so be careful).
public static upventurSettings Settings()
{
if (!HttpContext.Current.Items.Contains(AppConstants.SiteSettingsKey))
{
var currentPage = AppHelpers.CurrentPage();
if (currentPage != null)
{
var forumNode = currentPage.AncestorOrSelf(AppConstants.DocTypeForumRoot);
if (forumNode == null)
{
// Only do this is if we can't find the forum normally
forumNode = currentPage.DescendantOrSelf(AppConstants.DocTypeForumRoot);
if(forumNode==null)
{
var umbracoHelper = new UmbracoHelper(UmbracoContext.Current);
forumNode = umbracoHelper.TypedContentAtRoot().Where(x => x.IsDocumentType(AppConstants.DocTypeForumRoot)).FirstOrDefault();
}
}
HttpContext.Current.Items.Add(AppConstants.SiteSettingsKey, Settings(forumNode));
}
}
return HttpContext.Current.Items[AppConstants.SiteSettingsKey] as upventurSettings;
}
}
The key change is this, which examines the list of root nodes for the forum's main node.
// Only do this is if we can't find the forum normally
forumNode = currentPage.DescendantOrSelf(AppConstants.DocTypeForumRoot);
if(forumNode==null)
{
var umbracoHelper = new UmbracoHelper(UmbracoContext.Current);
forumNode = umbracoHelper.TypedContentAtRoot().Where(x => x.IsDocumentType(AppConstants.DocTypeForumRoot)).FirstOrDefault();
}
The text was updated successfully, but these errors were encountered:
+Dialog Global Node
When you have this situation, some of the queries don't locate the from node. Here is the fix for that in case anyone else runs into this:
Inside ContextHelper.Cs, the EnsureCorrectCultur() method needs to build the xpath string using the constant as follows
var homeNode = helper.TypedContentAtXPath("//root//"+ AppConstants.DocTypeForumRoot).FirstOrDefault();
Inside Dialog.cs, the Settings() method at the bottom should read like this so that it also looks at all of the nodes in the root, and will choose the first one (so be careful).
}
The key change is this, which examines the list of root nodes for the forum's main node.
The text was updated successfully, but these errors were encountered: