Bug #61135
closedIndexed Search not indexing
100%
Description
Suddenly the search index was not working anymore and I tried to find the error. First, I thought it was a configuration mistake, but after some testing and reading the documentation etc. it was clear, that everything was configured fine. So i started some debugging and i found a strange bug:
In the file typo3/sysext/indexed_search/Classes/Indexer.php in the function
public function hook_indexContent(&$pObj) { ...
there is the line 292:
$this->conf['mtime'] = $pObj->register['SYS_LASTCHANGED']
When I output the content of $pObj->register I can confirm, that no key 'SYS_LASTCHANGED' exists. Therefore, the Indexed Search extension tries to insert a NULL-value into the column 'mtime' in the index_phash table, but MySQL throws an error and the index_phash table stays empty!
I have insufficient knowledge about the internal processes of the typo3 core, but somehow the register-property of the TypoScriptFrontendController does not contain the 'SYS_LASTCHANGED' array-key. I thought, maybe this bug comes from an extension, but after removing all third party extensions, I assume it is a bug in the core, but i did not find the real culprit.
So, IMHO the best solution is:
$this->conf['mtime'] = ($pObj->register['SYS_LASTCHANGED'] !== NULL) ? $pObj->register['SYS_LASTCHANGED'] : $pObj->page['SYS_LASTCHANGED'];
Maybe somebody knows, why $pObj->register has no 'SYS_LASTCHANGED'-key and can fix the root of the problem. Until then, I would like to make a pull request on this change, but I just do not know how to do this.
It is a Typo3 6.0.13, but we also updated the system to Typo3 6.2 and even there some pages were not indexed and i assume that it was the same problem.