This is a follow-up of the issue https://www.drupal.org/project/search_api_solr/issues/3420882
and proposes a solution to detect a new language ConfigEvents::SAVE event
Steps to reproduce
- install Drupal 10.6.7
- install module search_api_solr 4.x + dependencies
- setup Solr server
- setup a search index
- add a new language - search index should reset
- execute: drush locale-import for an existing language - search index should not reset
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | 3589772_for_4_3_10.patch | 4.13 KB | aurelianzaha |
Issue fork search_api_solr-3589772
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
aurelianzaha commentedComment #4
klausiThanks, approach looks good to me. can you fix the PHPCS fails?
Is there a good way how to test this?
Comment #5
aurelianzaha commentedComment #6
aurelianzaha commentedthanks Klausi for feedback
I added to the issue description how to reproduce / test this and also fixed the CS issues on the MR
Comment #7
aurelianzaha commentedComment #8
klausiThanks, code looks good.
For testing: I think a unit test with mocks should be enough. We can assert that indexing must not be called when the language manager returns the language already.
Comment #9
klausiThanks a lot, looks good to me now.
Comment #10
aurelianzaha commentedthe patch from the MR does not apply against the latest release; therefore, I created a static patch for release 4.3.10
Comment #11
mkalkbrennerThe only real change is implementing the todo by
!in_array($matches[1], $languages).Comment #13
mkalkbrenner