Skip to content

[BUG] TYPO3 11 no_search_sub_entries = 1 removes the page from the index #3868

@Raidri

Description

@Raidri

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions