Bug #104734
closed
Indexed search PHP Error Undefined array key in SearchController.php line 264
Added by Guido Twieling about 2 months ago.
Updated 5 days ago.
Tags:
php error indexed search
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
After adding
if (!isset($searchData['pointer'] )) {
$searchData['pointer'] = 0;
}
to SearchController.php line 263 it works.
- Target version changed from 13 LTS to 13.3
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.
- Status changed from New to Accepted
- Status changed from Accepted to Under Review
- Related to Task #102945: Replace custom Indexed Search pagination with existing API added
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
- Status changed from Resolved to Closed
Also available in: Atom
PDF