Skip to content

Instantly share code, notes, and snippets.

@juampynr
Last active April 27, 2016 11:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save juampynr/c31ba8b13688942c214c76e3d7ee1b92 to your computer and use it in GitHub Desktop.
Save juampynr/c31ba8b13688942c214c76e3d7ee1b92 to your computer and use it in GitHub Desktop.
Overriding a config variable in Drupal 8
  1. Find the form field in core. Usually I use the label or description field for this.
  2. Check which configuration object and property is used for this field.
  3. At sites/default/settings.php, uncomment the code that loads settings.local.php and create the file with the overrides. For example, here is how to set verbose logging:
$config['system.logging']['error_level'] = 'verbose';
  1. Even though you may not see the form value change as in Drupal 7 (which is unfortunate), the configuration override will work.
@keopx
Copy link

keopx commented Apr 27, 2016

I think it's better to use sites/default/settings.local.php and uncomment:

<?php

if (file_exists(__DIR__ . '/settings.local.php')) {
  include __DIR__ . '/settings.local.php';
}

@juampynr
Copy link
Author

Agree! I just updated with. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment