Skip to content

Commit

Permalink
[BUGFIX] Fix middleware order for forced indexing (#1019)
Browse files Browse the repository at this point in the history
History:
--------
Because of a problem with lochmueller/staticfilecache,
crawler issue #642
changed the middleware loading order to execute crawler after static file cache.
(commit 0f7cb6a)

The source of the problem was that the crawler CrawlerInitialization middleware
overwrote the HTTP response that was generated by TYPO3.

Since commit 8a9b896
(issue #837)
the HTTP response is not destroyed/overwritten by crawler anymore
but moved into a HTTP header "X-T3Crawler-Meta".
The loading order does not influence compatibility with
static file cache anymore.

Bug
---
The changed loading order in the bug fix led to the problem that
> indexed_search:TypoScriptFrontendHook
was executed before
> crawler:CrawlerInitialization

But CrawlerInitialization must be run before TypoScriptFrontendHook
because it loads request data that are needed by indexed_search.

This led to bug #729
- forced reindexing by the crawler did not work anymore if the
page was already in cache.

Solution
--------
Restore the HTTP middleware loading order as it was before
the fix for #642, so that the code path is again:

1. crawler:FrontendUserAuthenticator
   (aoe/crawler/authentication)

2. crawler:CrawlerInitialization
   (aoe/crawler/initialization)

3. indexed_search:TypoScriptFrontendHook
   (called by typo3/cms-frontend/prepare-tsfe-rendering)

Resolves: #729
  • Loading branch information
cweiske authored Feb 13, 2024
1 parent 604cc67 commit d8097e7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog TYPO3 Crawler

## Crawler 11.0.8-dev
### Fixed
* Fix loading middleware order to make forced indexing work again [@cweiske](https://github.com/cweiske)

## Crawler 11.0.7
Crawler 11.0.7 was released on November 18th, 2022

Expand Down
2 changes: 1 addition & 1 deletion Configuration/RequestMiddlewares.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
'aoe/crawler/initialization' => [
'target' => CrawlerInitialization::class,
'before' => [
'typo3/cms-core/normalizedParams',
'typo3/cms-frontend/prepare-tsfe-rendering',
],
],
],
Expand Down

0 comments on commit d8097e7

Please sign in to comment.