- Issue created by @dieterholvoet
- 🇧🇪Belgium dieterholvoet Brussels
Never mind, I was wrong. Post update hooks also run before config import. Only deploy hooks run after config import, but those are a Drush specific concept so probably not a good idea to introduce here. The alternative is to make sure the fields aren't recreated, so no data is lost. I'll try to come up with a solution.
- 🇧🇪Belgium dieterholvoet Brussels
Update hooks updating data should still be post update hooks though, so I'll leave that in the MR.
- 🇧🇪Belgium dieterholvoet Brussels
The alternative is to make sure the fields aren't recreated, so no data is lost.
Yeah, there doesn't seem to be a way to do that.
updatedb
creates and fills the fields andconfig:import
overwrites them. The only way I can think about is to add a rabbit_hole_field_config_insert() hook and migrate the field there, after it's created. Not sure if we can use the Batch API at that point though.For my own purposes, I'm going to create a separate MR that makes this a deploy hook. It's a relatively easy and sufficient fix for people using Drush.
- 🇧🇪Belgium dieterholvoet Brussels
I can confirm that the deploy hook in MR !86 does the job, but like I said before only for people using
drush deploy
. - 🇦🇺Australia jannakha Brisbane!
The issue can be that
drush deploy
assumes up to date configuration (it's for deployment only) as it doesn't run config:export after updatedb, if there are any schema changes the old updatedb will update the schema, but config:import will import old schema in - that might create issues, like missing config, etcFollow steps in Deployment of a new feature with configuration management - note actions on LOCAL ENVIRONMENT → before running
drush deploy
on server. - 🇧🇪Belgium dieterholvoet Brussels
I'm aware of that, that's not the problem here. I described those steps in 'Steps to reproduce'.