mirror of
https://github.com/silverstripe/silverstripe-subsites
synced 2024-06-28 15:39:31 +02:00
Fixed subsite page selection when URL exists on SubsiteID = 0
This commit is contained in:
parent
538cfeda6a
commit
70ef6b0898
|
@ -49,10 +49,10 @@ class SiteTreeSubsites extends DataObjectDecorator {
|
||||||
|
|
||||||
if($context = DataObject::context_obj()) $subsiteID = (int)$context->SubsiteID;
|
if($context = DataObject::context_obj()) $subsiteID = (int)$context->SubsiteID;
|
||||||
else $subsiteID = (int)Subsite::currentSubsiteID();
|
else $subsiteID = (int)Subsite::currentSubsiteID();
|
||||||
|
|
||||||
// The foreach is an ugly way of getting the first key :-)
|
// The foreach is an ugly way of getting the first key :-)
|
||||||
foreach($query->from as $tableName => $info) {
|
foreach($query->from as $tableName => $info) {
|
||||||
$query->where[] = "`$tableName`.SubsiteID IN (0, $subsiteID)";
|
$query->where[] = "`$tableName`.SubsiteID IN ($subsiteID)";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user