Overwrite Core Task "ReindexContent" (Pages)

Hello

I am trying to overwrite the core-task “Reindex Content” with the scope of Pages. I only want to index published Pages so i need to change the following:

// public/concrete/src/Page/Command/ReindexPageCommandHandler.php
    
// [...]

public function __invoke($command)
{
    $c = Page::getByID($command->getPageID(), 'ACTIVE');
    if ($c && !$c->isError() && $c->getCollectionDatePublic() && $c->getCollectionDatePublicObject() <= new \DateTime()) {

// [...]

The part i added is the check for collectionDatePublic and that it is in the past.

I tried to place the File in the application folder at the same location as in the concrete folder but with no success.

Thanks for answering.

Instead of overriding that core task, perhaps don’t run that task and instead make a custom task that does what you want?

1 Like

yeah, i had to do that

1 Like