Project

General

Profile

Actions

Bug #86994

closed

indexed_search doesn't index pages using route enhancers

Added by Alexander Grein almost 6 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Indexed Search
Target version:
-
Start date:
2018-11-25
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
9
PHP Version:
7.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

To reproduce:
  1. Activate EXT:indexed_search
  2. Take any extension with a list and a show action (e.g. news) and add some records. The actions should be cached.
  3. Generate a simple page
  4. Add the frontend plugin with list/show action to it.
  5. Define a site configuration for the page
  6. Add a routeEnhancers of type "Extbase" definition for the show action of the choosen extension plugin
  7. 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
  8. Navigate to all detail pages (show action) of your generated records
  9. Open the page containing the frontend plugin of indexed_search
  10. 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

Actual result:
  • 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 ...


Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Bug #87855: Indexed_search problem if sql_mode have option ONLY_FULL_GROUP_BY enabledClosed2019-03-07

Actions
Precedes TYPO3 Core - Bug #89081: PHP Warning in Backend Module Indexing -> List: PagesClosed

Actions
Actions

Also available in: Atom PDF