adjusting query used in getSubsiteIDForDomain to prevent new DB fields being added to the SQL call if they are not yet added to the DB

This commit is contained in:
Tim Kung 2017-07-19 17:57:23 +12:00
parent 10302932a9
commit 24ebd1c9f9

View File

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