Bug #104734
closedIndexed search PHP Error Undefined array key in SearchController.php line 264
100%
Description
Hello.
I have integrated a search field into the main navigation in typo3 13.2.1. The link that is generated when the search is submitted is correct but I get a crash. I have attached the log file and the template.
Files
Updated by Guido Twieling 5 months ago · Edited
After adding
if (!isset($searchData['pointer'] )) {
$searchData['pointer'] = 0;
}
to SearchController.php line 263 it works.
Updated by Guido Twieling 5 months ago
- Target version changed from 13 LTS to 13.3
Updated by wini2 no-lastname-given 4 months ago
I'm using the same scenario like you. Unfortunately the change hasn't made it to the core in 13.3. Could you please be so kind to describe what to change (for a dilettante like me).
$paginator = new SlicePaginator(
$result['rows'],
((int)$searchData['pointer']) + 1,
$resultData['count'],
$searchData['numberOfResults'],
);
$result['pagination'] = new SimplePagination($paginator);
}
// Print a message telling which words in which sections we searched for
if (str_starts_with($searchData['sections'], 'rl')) {
$result['searchedInSectionInfo'] = (LocalizationUtility::translate('result.inSection', 'IndexedSearch') ?? '') . ' "' . $this->getPathFromPageId((int)substr($searchData['sections'], 4)) . '"';
}
After uptdating from 13.2 to 13.3 I noticed that the search sometimes works (around 20 % ), the other 80 % end up with the described error.
Updated by Gerrit Code Review 3 months ago
- Status changed from Accepted to Under Review
Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/86449
Updated by Benjamin Franzke 3 months ago
- Related to Task #102945: Replace custom Indexed Search pagination with existing API added
Updated by Benjamin Franzke 3 months ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 8788055397e99243ea3fdd5c4862d743f4ebc85f.