U4-1212, U4-1312 - fix Document.PathPublished

This commit is contained in:
Stephan
2012-12-13 15:48:46 -01:00
parent a5775e5a27
commit 3a93da6256

View File

@@ -778,11 +778,15 @@ namespace umbraco.cms.businesslogic.web
{
get
{
// get all nodes in the path to the document, and get all matching published documents
// the difference should be zero if everything is published
// test nodeObjectType to make sure we only count _content_ nodes
int x = SqlHelper.ExecuteScalar<int>(@"select count(node.id) - count(doc.nodeid)
from umbracoNode as node
left join cmsDocument as doc on (node.id=doc.nodeId and doc.published=1)
where '" + Path + ",' like " + SqlHelper.Concat("node.path", "',%'"));
return (x == 1);
where '" + Path + ",' like " + SqlHelper.Concat("node.path", "',%'") + @"
and node.nodeObjectType='C66BA18E-EAF3-4CFF-8A22-41B16D66A972'");
return (x == 0);
}
}