diff --git a/code/Subsite.php b/code/Subsite.php index bee42d2..371eeb7 100644 --- a/code/Subsite.php +++ b/code/Subsite.php @@ -310,6 +310,11 @@ JS; return $subsiteIDs[0]; } + // Check for a 'default' subsite + if ($default = DataObject::get_one('Subsite', 'DefaultSite = 1')) { + return $default->ID; + } + // Default subsite id = 0, the main site return 0; }