I wanted to use Drupal console to change some settings on a site:

  • To set the default 403 page to "/user/login"
  • To set user registration permission to "admin only"

Following the instructions here, which gives this example:

drupal settings:set  application.language es

I tried the following:

drupal settings:set user.settings.register admin_only
drupal settings:set user.settings register:admin_only
drupal settings:set user.settings.register "admin_only"

In all cases, I got a green bar saying that the setting had been successfully set. But looking at the site showed that it had not. Also doing drupal config:edit user.settings showed that it had not (but when I changed it in the editor, it did update successfully in real life).

The exact same thing happened with:

drupal settings:set system.site.page.403 /user/login

Am I doing something wrong, or is this an unimplemented part of drupal console?

  • 1
    Those instructions relate to the console's own settings file I think. Config edit is the way to do it using drupal console. If you want a one-liner, drush cset provides one. – Alfred Armstrong Apr 27 '18 at 14:30
  • Perfect! "drush cset user.settings register admin_only -y" works a treat. Please put your comment as an answer so I can accept it. – naomi Apr 27 '18 at 16:24
  • I have done so, @naomi – Alfred Armstrong Apr 30 '18 at 8:53

The "drupal settings:set" command updates the Drupal console's own settings rather than the configuration of the running Drupal site.

If you want a one-liner to update configuration, then you can use Drush for this job, eg:

drush cset user.settings register admin_only -y

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.