Bug #86994
closedindexed_search doesn't index pages using route enhancers
100%
Description
- Activate EXT:indexed_search
- Take any extension with a list and a show action (e.g. news) and add some records. The actions should be cached.
- Generate a simple page
- Add the frontend plugin with list/show action to it.
- Define a site configuration for the page
- Add a routeEnhancers of type "Extbase" definition for the show action of the choosen extension plugin
- Open a different browser than you are logged in into the backend (or use an incognito/private tab) and open the list page of the plugin
- Navigate to all detail pages (show action) of your generated records
- Open the page containing the frontend plugin of indexed_search
- Search for a word in your records
Expected:
A search result with all detail pages containing the search term with correct links to there detail page
- Only words from the first opened detail page are found
- The link to the detail page is not working
After debugging the hook_indexContent method of TYPO3\CMS\IndexedSearch\Indexer, the reason seems to be clear:
$pObj->cHash and $pObj->cHash_array are emty
Because of this, the following code think it's always the same page and only looks at the time of last indexing.
I build a small fix for myself to get the missing params from different places, but this could definitily not be the final solution.
Add this after line 306
if ($pObj->cHash === null && count($pObj->cHash_array) === 0 && count($pObj->pageArguments->getArguments()) > 0) { // Fix for missing cHash and cHash_array $queryParams = $pObj->pageArguments->getArguments(); $queryParams['id'] = $pObj->id; $cacheHashCalculator = GeneralUtility::makeInstance(CacheHashCalculator::class); $pObj->cHash_array = $cacheHashCalculator->getRelevantParameters(HttpUtility::buildQueryString($queryParams)); $pObj->cHash = $cacheHashCalculator->calculateCacheHash($pObj->cHash_array); }
With this piece of code indexing of detail pages and also detail link generation in the search result works again.
One thing which is still not woking, is the (correct) page title generation (indexedDocTitle):
Titles generated by the page title api will be ignored.
But may be this is another issue ...