Problem/Motivation

When the server configuration is saved with an empty set of synonyms, the resulting data is:

[
  0 => '',
];

This causes the settings alteration in \Drupal\elasticsearch_connector\Event\SynonymsSubscriber::onAlterSettings to always run.

Steps to reproduce

Save a server config with empty synonyms field
Inspect the resulting settings when the index is configured and pushed to Elastic.

Proposed resolution

Check for an empty value before exploding the field.

Remaining tasks

  1. Prep a small code alteration — merge request !177 created by @fathershawn in #2
  2. Add a test — done by @mparker17 by #5
  3. Review and feedback — done by @mparker17 in #5
  4. RTBC and feedback — skipped by @mparker17 in #5
  5. Commit to 9.0.x — done by @mparker17 in #6
  6. Backport to 8.0.x — merge request !180 created by @mparker17 in #8
  7. Commit to 8.0.x — merged by @mparker17 in #10
  8. Release 9.0.x — released in 9.0.0-alpha2
  9. Release 8.0.x — released in 8.0.0-alpha6

User interface changes

none

API changes

none

Data model changes

none

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

fathershawn created an issue. See original summary.

fathershawn’s picture

Status: Active » Needs review

mparker17 made their first commit to this issue’s fork.

mparker17’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community
Issue tags: +needs backport to 8.0.x

Okay, I've added a test (and updated #3576581: Add a Backend test for Synonyms to be clearer), and I'm happy with the production code.

I've updated the issue summary. Shortly I will merge this to 9.0.x.

I've also added the "needs backport to 8.0.x" tag so we do that too.

mparker17’s picture

Version: 9.0.x-dev » 8.0.x-dev
Issue summary: View changes
Issue tags: -needs backport to 8.0.x

Merged to 9.0.x; moving to 8.0.x

mparker17’s picture

Issue summary: View changes

Updating issue summary now that I've created !180.

mparker17’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Fixed

Merged to 8.0.x.

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.

mparker17’s picture

Issue summary: View changes
mparker17’s picture

Issue summary: View changes

Status: Fixed » Closed (fixed)

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