mirror of
https://github.com/silverstripe/silverstripe-fulltextsearch
synced 2024-10-22 14:05:29 +02:00
FIX Broken builds
This commit is contained in:
parent
cf2fa0ab0c
commit
4f92bcdbf5
@ -2,6 +2,7 @@
|
||||
|
||||
namespace SilverStripe\FullTextSearch\Search\Variants;
|
||||
|
||||
use InvalidArgumentException;
|
||||
use SilverStripe\Assets\File;
|
||||
use SilverStripe\CMS\Model\SiteTree;
|
||||
use SilverStripe\FullTextSearch\Search\Indexes\SearchIndex;
|
||||
@ -71,6 +72,12 @@ class SearchVariantSubsites extends SearchVariant
|
||||
return;
|
||||
}
|
||||
|
||||
if (is_numeric($state)) {
|
||||
$state = (int) $state;
|
||||
} else {
|
||||
throw new InvalidArgumentException("Invalid state ID. State ID should be number.");
|
||||
}
|
||||
|
||||
// Note: Setting directly to the SubsiteState because we don't want the subsite ID to be persisted
|
||||
// like Subsite::changeSubsite would do.
|
||||
SubsiteState::singleton()->setSubsiteId($state);
|
||||
|
Loading…
Reference in New Issue
Block a user