3

When the drupal config value (as defined in .schema.yml) is a sequence what is the correct syntax for drush config-set so that the value is a sequence not a simple string? For example, with the devel module drush config-get devel.settings error_handlers returns

'devel.settings:error_handlers': 1: 1

So what is the syntax to set the value to 4: 4. I have tried lots of combinations, such as 4:4 [4:4]. error_handlers.4 4 but have not hit on the right way yet. I could not find any examples or documentation, so asking here. Thanks.

2

Uh, I love riddles like this! And finally found a way!


You first have to delete the error_handlers config key.

$ drush -y cdel devel.settings error_handlers

And then set it again.

$ drush -y cset devel.settings error_handlers.4 4

Let's check.

$ drush cget devel.settings error_handlers
'devel.settings:error_handlers':
  4: 4

Yeah! 🎉


Just drush -y cset devel.settings error_handlers.4 4 without deleting it first would just append it and you'd end up with 1: 1 and 4: 4 both.

| improve this answer | |
  • 1
    Thank you @leymannx you are right. I am sure I tried that! I have also confirmed your second point, adding another gives both. Then cdel devel.settings error_handlers.1 will remove the unwanted one after. – Jonathan1055 Mar 5 at 9:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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