mirror of
https://github.com/silverstripe/silverstripe-fulltextsearch
synced 2024-10-22 14:05:29 +02:00
FIX Always use ?int for subsite state (#341)
This commit is contained in:
parent
2f56d944c6
commit
72dc54b0f8
@ -49,7 +49,7 @@ class SearchVariantSubsites extends SearchVariant
|
|||||||
|
|
||||||
public function currentState()
|
public function currentState()
|
||||||
{
|
{
|
||||||
return (string) SubsiteState::singleton()->getSubsiteId();
|
return SubsiteState::singleton()->getSubsiteId();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function reindexStates()
|
public function reindexStates()
|
||||||
@ -74,8 +74,8 @@ class SearchVariantSubsites extends SearchVariant
|
|||||||
|
|
||||||
if (is_numeric($state)) {
|
if (is_numeric($state)) {
|
||||||
$state = (int) $state;
|
$state = (int) $state;
|
||||||
} else {
|
} elseif ($state !== null) {
|
||||||
throw new InvalidArgumentException("Invalid state ID. State ID should be number.");
|
throw new InvalidArgumentException("Invalid state ID. State ID should be number or null.");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Note: Setting directly to the SubsiteState because we don't want the subsite ID to be persisted
|
// Note: Setting directly to the SubsiteState because we don't want the subsite ID to be persisted
|
||||||
|
Loading…
Reference in New Issue
Block a user