mirror of
https://github.com/silverstripe/silverstripe-fulltextsearch
synced 2024-10-22 14:05:29 +02:00
FIX Regression where pages would be indexed under all subsites
This commit is contained in:
parent
50c9f52d58
commit
465c072a99
@ -83,9 +83,20 @@ class SearchVariantSubsites extends SearchVariant
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isset($write['fields']['SiteTree:SubsiteID'])) {
|
||||||
|
$subsitesForWrite = array($write['fields']['SiteTree:SubsiteID']);
|
||||||
|
}
|
||||||
|
// files in subsite 0 should be in all subsites as they are global
|
||||||
|
elseif (isset($write['fields']['File:SubsiteID']) && intval($write['fields']['File:SubsiteID']) !== 0) {
|
||||||
|
$subsitesForWrite = array($write['fields']['File:SubsiteID']);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$subsitesForWrite = $subsites;
|
||||||
|
}
|
||||||
|
|
||||||
$next = array();
|
$next = array();
|
||||||
foreach ($write['statefulids'] as $i => $statefulid) {
|
foreach ($write['statefulids'] as $i => $statefulid) {
|
||||||
foreach ($subsites as $subsiteID) {
|
foreach ($subsitesForWrite as $subsiteID) {
|
||||||
$next[] = array(
|
$next[] = array(
|
||||||
'id' => $statefulid['id'],
|
'id' => $statefulid['id'],
|
||||||
'state' => array_merge(
|
'state' => array_merge(
|
||||||
|
Loading…
Reference in New Issue
Block a user