Merge pull request #452 from chrometoasters/bugfix/default-subsite-query

FIX Adjusting query used in getSubsiteIDForDomain()
This commit is contained in:
Steve Boyd 2020-09-12 18:37:35 +12:00 committed by GitHub
commit 5a4d613d8e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -312,7 +312,7 @@ class Subsite extends DataObject
$subsiteID = $subsiteIDs[0];
} else {
if ($default = DataObject::get_one(Subsite::class, '"DefaultSite" = 1')) {
if ($default = Subsite::get()->filter('DefaultSite', 1)->setQueriedColumns(['ID'])->first()) {
// Check for a 'default' subsite
$subsiteID = $default->ID;
} else {