Appsearch Configs Get Imported Out of Order

Created on 21 May 2024, about 1 year ago
Updated 29 May 2024, about 1 year ago

Problem/Motivation

When importing App search configs the following PHP error:

Error: Call to a member function getEngine() on null in Drupal\appsearch\Entity\Engine->preSave() (line 284 of /app/web/modules/contrib/elastic_enterprise_search/modules/appsearch/src/Entity/Engine.php)

The config order it is trying to import is:

lando drush cim
+------------+-----------------------------------------------------+-----------+
| Collection | Config | Operation |
+------------+-----------------------------------------------------+-----------+
| | appsearch.appsearch_engine.baltimorecity | Create |
| | appsearch.appsearch_searchui.testsearchui | Create

However, If I do the following:

1) remove the engine config from the project.
2) import the server Appseach config with drush cim
3) Replace the engine config file back into the config/sync folder
4) Import Engine configs
5) config import success, clear cache

This step works on my Drupal install (D10.2.6)

Steps to reproduce

On a d10 site Try to import Elastic Appsearch configs via drush

If the configs are in the order of Engine, then Server there should be a similar error response.

Proposed resolution

Changing the order in which the configs are imported so that it is Server before engine

πŸ› Bug report
Status

Active

Version

2.4

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024