-
-
Notifications
You must be signed in to change notification settings - Fork 261
Open
Labels
Description
Describe the bug
Maybe I understand the setting wrong but if I have a page with many subpages and I don't want to index the subpages. I set the variable to no_search_sub_entries = 1. If I do that and I try to index the pages, the page which has set the no_search_sub_entries = 1 is also excluded from the index.
is this the intended behaviour?
This function do that because the function findAllSubPageIdsByRootPage include the rootPage in the pageIds.
public function findAllPagesWithinNoSearchSubEntriesMarkedPages(): array
{
$queryBuilder = $this->getQueryBuilder();
$queryBuilder->getRestrictions()->removeAll();
$pageIds = [];
try {
$noSearchSubEntriesEnabledPagesStatement = $queryBuilder
->select('uid')
->from($this->table)
->where(
$queryBuilder->expr()->eq('no_search_sub_entries', $queryBuilder->createNamedParameter(1, PDO::PARAM_INT))
)->execute();
while (($pageRow = $noSearchSubEntriesEnabledPagesStatement->fetchAssociative()) !== false) {
$pageIds = array_merge($pageIds, $this->findAllSubPageIdsByRootPage((int)$pageRow['uid']));
}
} catch (Throwable $e) {
return [];
}
return $pageIds;
}
Maintainers notes:
Targets:
- main
- NOT in release-11.6.x, because we'll rebase it to 11.5.x again
- release-11.5.x(will be temporary unlocked for release 11.5.5)
- release-11.2.x(ELTS), if affected and cherri-pickable
- release-11.0.x(ELTS), if affected and cherri-pickable