diff --git a/code/SiteTreeSubsites.php b/code/SiteTreeSubsites.php index a79e5e8..de95910 100644 --- a/code/SiteTreeSubsites.php +++ b/code/SiteTreeSubsites.php @@ -54,6 +54,8 @@ class SiteTreeSubsites extends DataObjectDecorator { // The foreach is an ugly way of getting the first key :-) foreach($query->from as $tableName => $info) { + // The tableName should be SiteTree or SiteTree_Live... + if(strpos($tableName,'SiteTree') === false) break; $query->where[] = "`$tableName`.SubsiteID IN ($subsiteID)"; break; }