Quantcast
Channel: DevNet Questions
Viewing all articles
Browse latest Browse all 8901

K12 MVC Widget Cultureinfo issue

$
0
0
Hi all,When we run query to get data from content tree in custom form component class, UI culture (en-GB) is added to query. Our query do not set for culture. MultiDocumentQuery query = DocumentHelper.GetDocuments() .Path(productPath, PathTypeEnum.Children) .OnCurrentSite() .NestingLevel(1) .Published() .OrderBy(@NodeLevel, NodeOrder, NodeName@); We checked with SQL profiler, Culture condition is automatically added to query.exec sp_executesql N'SELECT * FROM View_CMS_Tree_Joined AS V WITH (NOLOCK, NOEXPAND) LEFT OUTER JOIN COM_SKU AS S WITH (NOLOCK) ON [V].[NodeSKUID] = [S].[SKUID] WHERE [NodeSiteID] = @NodeSiteID AND (([DocumentCanBePublished] = 1 AND ([DocumentPublishFrom] IS NULL OR [DocumentPublishFrom] @= @Now) AND ([DocumentPublishTo] IS NULL OR [DocumentPublishTo] @= @Now)) AND [NodeAliasPath] LIKE @NodeAliasPath AND [NodeLevel] @= @NodeLevel AND [DocumentCulture] = @DocumentCulture) ORDER BY NodeLevel, NodeOrder, NodeName',N'@NodeSiteID int,@Now datetime2(7),@NodeAliasPath nvarchar(11),@NodeLevel int,@DocumentCulture nvarchar(5)',@NodeSiteID=1,@Now='2019-07-30 13:06:50.1921954',@NodeAliasPath=N'/Products/%',@NodeLevel=2,@DocumentCulture=N'en-GB'We test this query on other MVC widget controller. we use same Query code but different culture is added to Query (en-US)exec sp_executesql N'SELECT * FROM View_CMS_Tree_Joined AS V WITH (NOLOCK, NOEXPAND) LEFT OUTER JOIN COM_SKU AS S WITH (NOLOCK) ON [V].[NodeSKUID] = [S].[SKUID] WHERE [NodeSiteID] = @NodeSiteID AND (([DocumentCanBePublished] = 1 AND ([DocumentPublishFrom] IS NULL OR [DocumentPublishFrom] @= @Now) AND ([DocumentPublishTo] IS NULL OR [DocumentPublishTo] @= @Now)) AND [NodeAliasPath] LIKE @NodeAliasPath AND [NodeLevel] @= @NodeLevel AND [DocumentCulture] = @DocumentCulture) ORDER BY NodeLevel, NodeOrder, NodeName',N'@NodeSiteID int,@Now datetime2(7),@NodeAliasPath nvarchar(11),@NodeLevel int,@DocumentCulture nvarchar(5)',@NodeSiteID=1,@Now='2019-07-30 13:08:10.0498590',@NodeAliasPath=N'/Products/%',@NodeLevel=2,@DocumentCulture=N'en-US'We want to get data from content tree with default Culture (en-US) even if we do not set the culture in query.Can you advise on this?

Viewing all articles
Browse latest Browse all 8901

Trending Articles