ext-solr
ext-solr copied to clipboard
[TASK] Use preAddModifyDocuments hook for pages
What this pr does
It calls the hook preAddModifyDocuments also for pages and deprecates the hook indexPagePostProcessPageDocument
How to test
- Register Hook
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['solr']['IndexQueueIndexer']['preAddModifyDocuments']['TestPageIndexerDocumentsModifier'] = TestPageIndexerDocumentsModifier::class;
- Index a page
- See
postProcessorField_stringS: postprocessed
in the indexed document
Fixes: #2285
The pipeline errors seem not related to my changes
@christophlehmann The tests on main and release-11.5.x branches will fail until TYPO3 11 LTS is fully supported. Is that a breaking change and unsuited for EXT:solr 11.1.x and 11.0.x?
@dkd-kaehm The change may lead to different behaviour in indexed documents when one uses the preAddModifyDocuments hook for records and (now for pages too).
Damn, I lost this nice change for TYPO3 11 release.
Even if it's a BC, I still merge it in release-11.5.x, because this issue exists since years and users want it. The release note about this change want to be bolded and marked with !!!
Unfortunately, we overlooked in this discussion that while preAddModifyDocuments
does actually not work, there are 3 hooks that could be used:
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['solr']['Indexer']['indexPagePostProcessPageDocument']
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['solr']['Indexer']['indexPageSubstitutePageDocument']
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['solr']['Indexer']['indexPageAddDocuments']
We plan to merge and simplify the hooks later, see #3441