From 625ab4e23528784a7ab402703513bb525a83af58 Mon Sep 17 00:00:00 2001 From: Tom Rix Date: Mon, 1 Mar 2010 21:49:22 +0000 Subject: [PATCH] MINOR make the 'default site' checkbox on a subsite actually work. If no subsite was found matching the requested domain, before returning 0 (the 'main' site), it will check for a 'default' site. (from r87086) --- code/Subsite.php | 5 +++++ 1 file changed, 5 insertions(+) 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; }