Skip to content

Commit

Permalink
ENH Use cached table list from ClassInfo (#564)
Browse files Browse the repository at this point in the history
undefined
  • Loading branch information
lekoala authored Mar 28, 2024
1 parent 0fe63e9 commit 6ba7385
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Model/Subsite.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
use SilverStripe\Subsites\State\SubsiteState;
use SilverStripe\Versioned\Versioned;
use UnexpectedValueException;
use SilverStripe\Core\ClassInfo;

/**
* A dynamically created subsite. SiteTree objects can now belong to a subsite.
Expand Down Expand Up @@ -259,7 +260,8 @@ public static function getSubsiteIDForDomain($host = null, $checkPermissions = t

$domainTableName = $schema->tableName(SubsiteDomain::class);

if (!DB::get_schema()->hasTable($domainTableName)) {
// ClassInfo::hasTable provides a cached table list
if (!ClassInfo::hasTable($domainTableName)) {
// Table hasn't been created yet. Might be a dev/build, skip.
return 0;
}
Expand Down

0 comments on commit 6ba7385

Please sign in to comment.