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

CommentFileSizeAuthor
#10 3589772_for_4_3_10.patch4.13 KBaurelianzaha
Command icon 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

aurelianzaha created an issue. See original summary.

aurelianzaha’s picture

Status: Active » Needs review
klausi’s picture

Version: 4.3.10 » 4.x-dev
Status: Needs review » Needs work

Thanks, approach looks good to me. can you fix the PHPCS fails?

Is there a good way how to test this?

aurelianzaha’s picture

Issue summary: View changes
aurelianzaha’s picture

thanks Klausi for feedback

I added to the issue description how to reproduce / test this and also fixed the CS issues on the MR

aurelianzaha’s picture

Status: Needs work » Needs review
klausi’s picture

Status: Needs review » Needs work
Issue tags: +Needs tests

Thanks, 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.

klausi’s picture

Status: Needs work » Reviewed & tested by the community
Issue tags: -Needs tests

Thanks a lot, looks good to me now.

aurelianzaha’s picture

StatusFileSize
new4.13 KB

the patch from the MR does not apply against the latest release; therefore, I created a static patch for release 4.3.10

mkalkbrenner’s picture

The only real change is implementing the todo by !in_array($matches[1], $languages) .

mkalkbrenner’s picture

Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.