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