ext-solr icon indicating copy to clipboard operation
ext-solr copied to clipboard

[TASK] Use preAddModifyDocuments hook for pages

Open christophlehmann opened this issue 2 years ago • 3 comments

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

christophlehmann avatar Oct 24 '21 12:10 christophlehmann

The pipeline errors seem not related to my changes

christophlehmann avatar Oct 24 '21 12:10 christophlehmann

@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 avatar Oct 24 '21 13:10 dkd-kaehm

@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).

christophlehmann avatar Oct 24 '21 13:10 christophlehmann

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 !!!

dkd-kaehm avatar Oct 07 '22 10:10 dkd-kaehm

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

dkd-friedrich avatar Dec 23 '22 10:12 dkd-friedrich