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

Kentico document query API always returns empty result

$
0
0
I have the following query:var newsItems = tree.SelectNodes() .Types(pageTypesArray) .Path(path) .OrderBy(orderBy) .CombineWithDefaultCulture(false) .Page(page, count) .OnCurrentSite() .NestingLevel(-1) .Culture(CurrentDocument.DocumentCulture) .InCategories(categories) .TopN(topN) .Where("ListableDocumentImage is not null AND ListableDocumentImage != ''") .Columns(columns); Which translates like so:WITH AllData AS ( SELECT TOP 6 * for brevity, ROW_NUMBER() OVER (ORDER BY [NewsOccurrenceDate] DESC) AS [CMS_RN] FROM View_CMS_Tree_Joined AS V WITH (NOLOCK, NOEXPAND) INNER JOIN SOS_News AS C WITH (NOLOCK) ON [V].[DocumentForeignKeyValue] = [C].[NewsID] AND V.ClassName = N'News' 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 [DocumentCulture] = @DocumentCulture **AND 0 = 1)** @@@------------------- WHERE DID THIS COME FROM????? ) SELECT *, (SELECT COUNT(*) FROM AllData) AS [CMS_TOT] FROM AllData WHERE CMS_RN BETWEEN 4 AND 6 ORDER BY CMS_RN Has anyone ever come across anything like this before? I can't figure out why they're sticking in the AND 0=1 in my where clause.

Viewing all articles
Browse latest Browse all 8901

Trending Articles