Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

!!![TASK] Use preAddModifyDocuments hook for pages #3076

Conversation

christophlehmann
Copy link
Contributor

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 christophlehmann changed the title Fix 2285 use pre add modify documents hook for pages [TASK] Use preAddModifyDocuments hook for pages Oct 24, 2021
@christophlehmann christophlehmann changed the title [TASK] Use preAddModifyDocuments hook for pages WIP: [TASK] Use preAddModifyDocuments hook for pages Oct 24, 2021
@christophlehmann christophlehmann changed the title WIP: [TASK] Use preAddModifyDocuments hook for pages [TASK] Use preAddModifyDocuments hook for pages Oct 24, 2021
@christophlehmann
Copy link
Contributor Author

The pipeline errors seem not related to my changes

@christophlehmann christophlehmann force-pushed the fix-2285-use-preAddModifyDocuments-hook-for-pages branch from e6b1005 to 534d52d Compare October 24, 2021 12:56
@dkd-kaehm
Copy link
Collaborator

dkd-kaehm commented Oct 24, 2021

@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?

@christophlehmann
Copy link
Contributor Author

@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 christophlehmann force-pushed the fix-2285-use-preAddModifyDocuments-hook-for-pages branch from 534d52d to 81d6086 Compare April 8, 2022 15:59
@christophlehmann christophlehmann changed the base branch from main to release-11.5.x April 8, 2022 15:59
@dkd-kaehm
Copy link
Collaborator

dkd-kaehm commented Oct 7, 2022

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 dkd-kaehm force-pushed the fix-2285-use-preAddModifyDocuments-hook-for-pages branch from 81d6086 to 837792c Compare October 7, 2022 10:34
@dkd-kaehm dkd-kaehm force-pushed the fix-2285-use-preAddModifyDocuments-hook-for-pages branch from 837792c to 530c1e1 Compare October 7, 2022 11:10
dkd-kaehm pushed a commit to dkd-kaehm/ext-solr that referenced this pull request Oct 7, 2022
Now the preAddModifyDocuments hook is called for pages as well.
Also the indexPagePostProcessPageDocument hook is deprecated
and superseeded by:

```
 $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['solr']['IndexQueueIndexer']
   ['preAddModifyDocuments']
```

Fixes: TYPO3-Solr#2285
Ports: TYPO3-Solr#3076
@dkd-kaehm dkd-kaehm changed the title [TASK] Use preAddModifyDocuments hook for pages !!![TASK] Use preAddModifyDocuments hook for pages Oct 7, 2022
@dkd-kaehm dkd-kaehm force-pushed the fix-2285-use-preAddModifyDocuments-hook-for-pages branch 2 times, most recently from 0703845 to 0a84e5d Compare October 7, 2022 15:51
dkd-kaehm pushed a commit to dkd-kaehm/ext-solr that referenced this pull request Oct 7, 2022
Now the preAddModifyDocuments hook is called for pages as well.
Also the indexPagePostProcessPageDocument hook is deprecated
and superseeded by:

```
 $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['solr']['IndexQueueIndexer']
   ['preAddModifyDocuments']
```

Fixes: TYPO3-Solr#2285
Ports: TYPO3-Solr#3076
Now the preAddModifyDocuments hook is called for pages as well.
Also the indexPagePostProcessPageDocument hook is deprecated
and superseeded by:

```
 $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['solr']['IndexQueueIndexer']['preAddModifyDocuments']
```

Fixes: TYPO3-Solr#2285
@dkd-kaehm dkd-kaehm force-pushed the fix-2285-use-preAddModifyDocuments-hook-for-pages branch from 0a84e5d to c5671f0 Compare October 7, 2022 16:56
dkd-kaehm pushed a commit to dkd-kaehm/ext-solr that referenced this pull request Oct 7, 2022
Now the preAddModifyDocuments hook is called for pages as well.
Also the indexPagePostProcessPageDocument hook is deprecated
and superseeded by:

```
 $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['solr']['IndexQueueIndexer']
   ['preAddModifyDocuments']
```

Fixes: TYPO3-Solr#2285
Ports: TYPO3-Solr#3076
dkd-kaehm pushed a commit that referenced this pull request Oct 8, 2022
Now the preAddModifyDocuments hook is called for pages as well.
Also the indexPagePostProcessPageDocument hook is deprecated
and superseeded by:

```
 $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['solr']['IndexQueueIndexer']
   ['preAddModifyDocuments']
```

Fixes: #2285
Ports: #3076
@dkd-kaehm dkd-kaehm merged commit f08aab3 into TYPO3-Solr:release-11.5.x Oct 8, 2022
@dkd-kaehm dkd-kaehm mentioned this pull request Dec 22, 2022
dkd-kaehm added a commit to dkd-kaehm/ext-solr that referenced this pull request Dec 22, 2022
This is a maintenance release for TYPO3 11.5, containing:

- [BUGFIX] Do not include removed strptime() (TYPO3-Solr#3335)
- [BUGFIX:BP:11.5] Do not handle page updates on new page with uid 0 (TYPO3-Solr#3344)
- [BUGFIX:BP:11.5] Shortcircuit work in SolrRoutingMiddleware (TYPO3-Solr#3341)
- !!![TASK] Use preAddModifyDocuments  hook for pages (TYPO3-Solr#3076)
- [BUGFIX] Fix array key access in ext_getSetup (Backport 11.5) (TYPO3-Solr#3361)
- [TASK:BP:11.5] Indexing configuration icon fallback (TYPO3-Solr#3371)
- [BUGFIX:BP:11.5] Do not index missing fields (TYPO3-Solr#3372)
- [TASK:BP:11.5] Introduce index queue type setting (TYPO3-Solr#3370)
- [TASK:BP:11.5] Do not index language with unconfigured core (TYPO3-Solr#3373)
- [BUGFIX] Make API eID script compatible with TYPO3 v11.5 (TYPO3-Solr#3350)
- [BUGFIX] Type-hinting for SiteUtility::getConnectionProperty() (TYPO3-Solr#3396)
- [TASK:BP:11.5] Introduce generic EXT:solr exception (TYPO3-Solr#3422)
- [BUGFIX:BP:11.5] Fix frontend Solr connection initialization (TYPO3-Solr#3425)
- [ACTIONS:2022.12.22] Use fixed typo3/coding-standards 0.6.x < 0.7.0 for TYPO3 11.5 (TYPO3-Solr#3429)
- [TASK:Security] Update jQuery and its plugin libs (TYPO3-Solr#3428)
- [BUGFIX:P:11.5] Proper check for config.index_enable (TYPO3-Solr#3433)
- [BUGFIX:P:11.5] Typecast $timestamp to int in TimestampToUtcIsoDate (TYPO3-Solr#3434)
- [BUGFIX:P:11.5] prevent undefined array key warning if filter is empty (TYPO3-Solr#3435)
- [FEATURE] Add signal before search in resultsAction (TYPO3-Solr#3392)
- [BUGFIX] Fix php warning undefined array key no_search_sub_entries (TYPO3-Solr#3381)

Please read the release notes:
https://github.com/TYPO3-Solr/ext-solr/releases/tag/11.5.1

---

How to Get Involved

There are many ways to get involved with Apache Solr for TYPO3:

* Submit bug reports and feature requests on GitHub
* Ask or help or answer questions in our Slack channel
* Provide patches through pull requests or review and comment on
  existing pull requests
* Go to www.typo3-solr.com or call dkd to sponsor the ongoing
  development of Apache Solr for TYPO3

Support us by becoming an EB partner:
https://shop.dkd.de/Produkte/Apache-Solr-fuer-TYPO3/

or call:
+49 (0)69 - 2475218 0
dkd-kaehm added a commit to dkd-kaehm/ext-solr that referenced this pull request Dec 22, 2022
This is a maintenance release for TYPO3 11.5, containing:

- [BUGFIX] Do not include removed strptime() (TYPO3-Solr#3335)
- [BUGFIX:BP:11.5] Do not handle page updates on new page with uid 0 (TYPO3-Solr#3344)
- [BUGFIX:BP:11.5] Shortcircuit work in SolrRoutingMiddleware (TYPO3-Solr#3341)
- !!![TASK] Use preAddModifyDocuments  hook for pages (TYPO3-Solr#3076)
- [BUGFIX] Fix array key access in ext_getSetup (Backport 11.5) (TYPO3-Solr#3361)
- [TASK:BP:11.5] Indexing configuration icon fallback (TYPO3-Solr#3371)
- [BUGFIX:BP:11.5] Do not index missing fields (TYPO3-Solr#3372)
- [TASK:BP:11.5] Introduce index queue type setting (TYPO3-Solr#3370)
- [TASK:BP:11.5] Do not index language with unconfigured core (TYPO3-Solr#3373)
- [BUGFIX] Make API eID script compatible with TYPO3 v11.5 (TYPO3-Solr#3350)
- [BUGFIX] Type-hinting for SiteUtility::getConnectionProperty() (TYPO3-Solr#3396)
- [TASK:BP:11.5] Introduce generic EXT:solr exception (TYPO3-Solr#3422)
- [BUGFIX:BP:11.5] Fix frontend Solr connection initialization (TYPO3-Solr#3425)
- [ACTIONS:2022.12.22] Use fixed typo3/coding-standards 0.6.x < 0.7.0 for TYPO3 11.5 (TYPO3-Solr#3429)
- [TASK:Security] Update jQuery and its plugin libs (TYPO3-Solr#3428)
- [BUGFIX:P:11.5] Proper check for config.index_enable (TYPO3-Solr#3433)
- [BUGFIX:P:11.5] Typecast $timestamp to int in TimestampToUtcIsoDate (TYPO3-Solr#3434)
- [BUGFIX:P:11.5] prevent undefined array key warning if filter is empty (TYPO3-Solr#3435)
- [FEATURE] Add signal before search in resultsAction (TYPO3-Solr#3392)
- [BUGFIX] Fix php warning undefined array key no_search_sub_entries (TYPO3-Solr#3381)

Please read the release notes:
https://github.com/TYPO3-Solr/ext-solr/releases/tag/11.5.1

---

How to Get Involved

There are many ways to get involved with Apache Solr for TYPO3:

* Submit bug reports and feature requests on GitHub
* Ask or help or answer questions in our Slack channel
* Provide patches through pull requests or review and comment on
  existing pull requests
* Go to www.typo3-solr.com or call dkd to sponsor the ongoing
  development of Apache Solr for TYPO3

Support us by becoming an EB partner:
https://shop.dkd.de/Produkte/Apache-Solr-fuer-TYPO3/

or call:
+49 (0)69 - 2475218 0
@dkd-friedrich
Copy link
Member

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-kaehm added a commit that referenced this pull request Dec 23, 2022
This is a maintenance release for TYPO3 11.5, containing:

- [BUGFIX] Do not include removed strptime() (#3335)
- [BUGFIX:BP:11.5] Do not handle page updates on new page with uid 0 (#3344)
- [BUGFIX:BP:11.5] Shortcircuit work in SolrRoutingMiddleware (#3341)
- !!![TASK] Use preAddModifyDocuments  hook for pages (#3076)
- [BUGFIX] Fix array key access in ext_getSetup (Backport 11.5) (#3361)
- [TASK:BP:11.5] Indexing configuration icon fallback (#3371)
- [BUGFIX:BP:11.5] Do not index missing fields (#3372)
- [TASK:BP:11.5] Introduce index queue type setting (#3370)
- [TASK:BP:11.5] Do not index language with unconfigured core (#3373)
- [BUGFIX] Make API eID script compatible with TYPO3 v11.5 (#3350)
- [BUGFIX] Type-hinting for SiteUtility::getConnectionProperty() (#3396)
- [TASK:BP:11.5] Introduce generic EXT:solr exception (#3422)
- [BUGFIX:BP:11.5] Fix frontend Solr connection initialization (#3425)
- [ACTIONS:2022.12.22] Use fixed typo3/coding-standards 0.6.x < 0.7.0 for TYPO3 11.5 (#3429)
- [TASK:Security] Update jQuery and its plugin libs (#3428)
- [BUGFIX:P:11.5] Proper check for config.index_enable (#3433)
- [BUGFIX:P:11.5] Typecast $timestamp to int in TimestampToUtcIsoDate (#3434)
- [BUGFIX:P:11.5] prevent undefined array key warning if filter is empty (#3435)
- [FEATURE] Add signal before search in resultsAction (#3392)
- [BUGFIX] Fix php warning undefined array key no_search_sub_entries (#3381)

Please read the release notes:
https://github.com/TYPO3-Solr/ext-solr/releases/tag/11.5.1

---

How to Get Involved

There are many ways to get involved with Apache Solr for TYPO3:

* Submit bug reports and feature requests on GitHub
* Ask or help or answer questions in our Slack channel
* Provide patches through pull requests or review and comment on
  existing pull requests
* Go to www.typo3-solr.com or call dkd to sponsor the ongoing
  development of Apache Solr for TYPO3

Support us by becoming an EB partner:
https://shop.dkd.de/Produkte/Apache-Solr-fuer-TYPO3/

or call:
+49 (0)69 - 2475218 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] preAddModifyDocuments Hook is not executed in Page indexing context
3 participants