0

I have EForm module installed on my Drupal 8 website. My customer uses EForm module to create new forms. The problem is that newly created forms are storing in configurations. Every time I deploy my code to the production instance I deploy it without configurations for newly created forms and when I do sync on the production it deletes forms that were added by the customer since they are not in my configurations. Now I need to download latest backup from the production to keep customers forms and it is very annoying. So I wonder is there any way to lock particular configurations in Drupal 8 either using contrib module or programmatically.

I've found Configuration Read-only mode module but it locks all configurations but not particular one.

2 Answers 2

1

What you can do is to use --skip-modules if you sync configuration with drush. You can even put it in a drushrc file so you don't need to remember it.

Doing will will make drush skip the sync of the entire module. It's not possible to omit only some config files, like a reg ex pattern etc.

1
  • Thanks for answer. I was thinking about it, but I would like to be able to lock configuration instead of skipping. New developers may not know about skipping during drush sync or even use UI sync and they can break forms added by the customer
    – Ggege
    Commented Oct 28, 2016 at 12:22
1

You could have a look at the drush CMI tools recently published by PreviousNext: https://www.previousnext.com.au/blog/introducing-drush-cmi-tools

That allows you to have exclude patterns of certain config, so they're not maintained with git at all.

I don't use them yet. My workflow is basically to do new development in a separate branch, staging or something else. Then before the deployment, I export production config, sync it back to local, commit that, merge in your branch that contains the new config, resolve possible merge conflicts, deploy, run drush cim and verify that there are only expected config changes.

It's not perfect, there is a possibility that a config change happens right between those steps, but it is rather unlikely and in the case of contact forms or eforms, easy to spot.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.