Skip to content

Commit

Permalink
Merge pull request #2 from tgaertner/feature/only-crawl-default-pages
Browse files Browse the repository at this point in the history
exclude special pages from crawling
  • Loading branch information
bmack authored Apr 24, 2020
2 parents 33370ac + abfc461 commit 0baef99
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions Classes/Service/PageWarmupService.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,17 @@ public function __construct($excludePages = [])
public function warmUp(SymfonyStyle $io)
{
$this->io = $io;
// fetch all pages which are not deleted and in live workspace

// fetch all pages which are not deleted and in live workspace and not one of excluded types
$excludeDocTypes = [
3, // external link
4, // shortcut
6, // be user section
7, // mount point
199, // menu separator
254, // folder
255 // recycler
];
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
->getQueryBuilderForTable('pages');
$queryBuilder->getRestrictions()
Expand All @@ -53,7 +63,7 @@ public function warmUp(SymfonyStyle $io)
->add(GeneralUtility::makeInstance(HiddenRestriction::class))
->add(GeneralUtility::makeInstance(DeletedRestriction::class));
$statement = $queryBuilder->select('*')->from('pages')->where(
$queryBuilder->expr()->lt('doktype', 199),
$queryBuilder->expr()->notIn('doktype', $excludeDocTypes),
$queryBuilder->expr()->eq('sys_language_uid', 0)
)->execute();

Expand Down

0 comments on commit 0baef99

Please sign in to comment.