Skip to main content

Questions tagged [configuration]

Use this tag for questions about Drupal's configuration system.

Filter by
Sorted by
Tagged with
81 votes
4 answers
92k views

What does "The provided host name is not valid for this server" mean?

I am running a Drupal 8 website, and when I browse to any page, I get a plain white page with just the following error message on it. The provided host name is not valid for this server. What does ...
80 votes
7 answers
9k views

Suggestions for settings.php - Local dev, Development server, Live server

Basically, one of the greatest questions of all time: What are some ways you're using settings.php in your development/staging workflow? Right now, I have my settings.php file set up like the ...
geerlingguy's user avatar
  • 5,483
73 votes
9 answers
65k views

How can I import the configuration on a different site?

I have this error when I try to import the config of an another site: The staged configuration cannot be imported, because it originates from a different site than this site. You can only ...
Axel Briche's user avatar
  • 2,001
47 votes
15 answers
48k views

How do I remove a configuration object from the active configuration?

I'm writing a custom module for Drupal 8. It defines a field storage configuration object, in a file called modules/mymod/config/install/field.storage.bloom_stem.bs_twitter_ac.yml. The problem is ...
artfulrobot's user avatar
  • 4,059
41 votes
7 answers
25k views

How do I update the configuration of a module?

I'm building a custom module in Drupal 8. It includes some YAML config files. As I develop I need to change and add to the config, e.g. to add another field onto my custom entity. At present the only ...
artfulrobot's user avatar
  • 4,059
36 votes
5 answers
43k views

Import a single yml configuration file

Is it possible to import one single configuration file by specifying its path, or a group of Yaml files contained in a specific module?
David Riccitelli's user avatar
28 votes
10 answers
8k views

How to prevent Devel module to be installed on production environments

Using the new Drupal 8 Configuration manager, how can I prevent it from installing the Devel module on certain environments? As far as I know, installing it on my local means the next time I export ...
cambraca's user avatar
  • 755
22 votes
6 answers
31k views

Site UUID in source storage does not match the target storage

When I run drush cim -y on my staging instance of my site I get the following error: Drupal\Core\Config\ConfigImporterException: There were errors validating the config synchronization. in Drupal\...
albertski's user avatar
  • 3,497
21 votes
3 answers
18k views

How do I set a variable in the configuration file setting.php and use it from code?

How do I set a variable in the configuration file setting.php and use it from code?
David's user avatar
  • 343
19 votes
8 answers
16k views

How can I exclude configuration from import/export?

I thought this was a simple use case of the new Configuration management system, but I haven't had any luck finding out how to solve this: Problem I want to store configuration in git and use drush ...
googletorp's user avatar
  • 35.4k
18 votes
1 answer
738 views

Technical advantages of either Configuration or Features over the other?

In short, Configuration vs Features, in Drupal 7, fight! As always, technical advantages, or other hard facts, as we don't do discussions here. Drupal 7 specific to limit to scope, as CMI vs Features ...
Letharion's user avatar
  • 27.5k
15 votes
10 answers
23k views

How do I fix a "Mismatched entity and/or field definitions" error on my configuration?

I'm getting the following error on my Drupal 8 configuration page. Entity/field definitions Mismatched entity and/or field definitions The following changes were detected in the entity type and field ...
W01F's user avatar
  • 443
15 votes
1 answer
8k views

How to remove mymodule configurations on uninstall [duplicate]

I have created a custom module and created a yml file to create a menu system.menu.custom_menu.yml id: custom_menu label: 'Custom menu' description: 'Custom menu.' langcode: en locked: true ...
Ahmad's user avatar
  • 2,845
15 votes
6 answers
17k views

config-import error: These entities need to be deleted before importing

I have two Drupal environments with the same system.site:uuid In the main Drupal I export the configuration with command: drush config-export deploy -y In the destination drupal I import the ...
monkeyUser's user avatar
15 votes
1 answer
4k views

How to disable modules using config split?

I have created different split for each environement (local, dev, test, prod) using the Configuration Split module. How can manage modules (enable/disable) in each environment? Should I keep core....
Cool's user avatar
  • 1,832
15 votes
1 answer
2k views

What is the difference between the $config and the $settings variables in settings.php?

In the settings.php file of Drupal 8 installations, there are two different types of variables; $settings and $config. In Drupal 7 we used only $conf variable. What's the difference between $config ...
Rafal Enden's user avatar
15 votes
3 answers
442 views

How do I deploy/manage similar sites from an unique profile, without dumps?

I do not like the "cloning website" solutions which implies dumping a database and importing this dump in another environment. This does not look like a real world way of deploying several instances ...
regilero's user avatar
  • 226
14 votes
2 answers
13k views

Attempt to create a field body that does not exist on entity type node

I am getting the following error: Drupal\Core\Field\FieldException: Attempt to create a field body that does not exist on entity type node. in Drupal\field\Entity\FieldConfig->...
Jack Ryan's user avatar
  • 2,307
14 votes
2 answers
5k views

What are cloned sites in Drupal 8?

When trying to export my site configurations from one Drupal 8 site to other I keep getting the following error The staged configuration cannot be imported, because it originates from a different ...
Gokul N K's user avatar
  • 6,723
13 votes
2 answers
17k views

Drupal 8 variable_get

I have some code in Drupal 7 what are using variable_get. Now I would like to write the code in Drupal 8. So I was reading this but its didn't help me a lot. How to write this code in Drupal 8 from ...
SakaSerbia's user avatar
12 votes
4 answers
10k views

Export menu configuration [closed]

Looking for a way to export menu configuration. The Configuration management system will export the menu itself, but not the menu links configuration. I am looking for a way to put one of those mega ...
brittany_p's user avatar
11 votes
3 answers
6k views

How to check for differences in config

Is there any way to check for differences with config in Drush 8? I checked the list of drush 8 config commands and I couldn't find anything. The reason I need this is that I have a site that runs ...
Patrick Kenny's user avatar
11 votes
1 answer
3k views

What order should configuration import and module updates be run?

Since the schema version of modules is stored in the key-value storage, it is unique to each site and is not synced through configuration management. That makes sense, since updates may need to make ...
gapple's user avatar
  • 1,574
11 votes
2 answers
6k views

Exporting fields for content type

The configuration export feature of Drupal 8 would seem to be a very useful feature. However, I'm not sure I completely understand how it works. For example, if I do a single export, choose "Content ...
James's user avatar
  • 1,191
10 votes
4 answers
26k views

How do I set variables for variable_get()?

I am trying to understand variable_get(). I read so far that you can set variables in the settings.php using the $conf array and retrieve them later in code by using variable_get(). I have read that ...
cthrucode's user avatar
  • 155
10 votes
3 answers
6k views

Manage config translations programmatically

My module creates and manages some config_entities programmatically (ie. not through an EntityForm) in response to associated content entities being saved. In order to handle multi-language content ...
Christoph Burschka's user avatar
10 votes
7 answers
17k views

Looking for Acquia Dev Desktop database settings

I am using Acquia Dev Desktop to create local Drupal installations. I am also using Bluehost as a service. Unfortunately, Bluehost uses table prefixes for Drupal tables. So, if I import something ...
Jérôme Verstrynge's user avatar
10 votes
1 answer
6k views

Best Way to Handle Variables Per Environment

I have a custom module. It's FormBase to create a form. And on submit, I post values to an API. All this works. But I want to change the base URL variable (which is used in multiple methods) so that ...
xpersonas's user avatar
  • 552
10 votes
2 answers
3k views

Disabling module with config sync and removing with composer

I have an issue disabling modules, I've searched but cannot find something useful: - Developer A disable module and via composer remove it - I pull his changes so i run composer install that remove ...
Francesco's user avatar
  • 133
10 votes
2 answers
6k views

Drupal Master/Slave Replication

I've setup two MySQL servers with Master/Slave replication for the drupal database and I've confirmed the databases are in sync and replicating. I am now trying to point drupal to both databases ...
Brad's user avatar
  • 413
9 votes
2 answers
6k views

Configuration export/import doesn't work

I did a drush config-export staging on a local version of my site then a drush config-import staging on the server. It imported all the taxonomy vocabulary but no terms. I also tried it via the UI (...
Rooster242's user avatar
9 votes
6 answers
9k views

Is there a way to clone a content type and its fields?

I have a content type named "event_xyz" that I want to rename to "event". I figure I can clone the content type and then delete the original. But I don't see any tuts or modules on how to do this. ...
oknate's user avatar
  • 14.5k
9 votes
2 answers
841 views

Best way to delete all variables when uninstalling module

I'm writing a module that writes several variables (three, four variables for every content type, and other). Which method should I use to delete them on hook_uninstall? Is it safe to perform a ...
arrubiu's user avatar
  • 3,294
9 votes
1 answer
2k views

Difference between $this->config and \Drupal::config in ConfigFormBase

I want to override a custom module configuration in the settings.php file. So the configuration in database can be independent from the environment. $config['my_module.settings']['prop'] = 'foo'; I ...
Eria's user avatar
  • 481
9 votes
2 answers
808 views

How do customize settings.php during installation profile

I'm creating an installation profile for my current company internal project. During the installation process, one of the custom modules crashes during init(), since it tries to use one global ...
Paulo Gomes's user avatar
8 votes
5 answers
12k views

Unable to install the XYZ module since it requires the A module

When running (right after site install) the drush cim -y command, the following error appears: Drupal\Core\Config\ConfigImporterException: There were errors validating the config synchronization. in ...
ssibal's user avatar
  • 3,225
8 votes
2 answers
6k views

How to load field configurations in code

I have defined fields using the UI, and some more fields using YAML files in my custom module, e.g.: The field storage is defined in field.storage.node.my_heading: langcode: en status: true ...
rudolfbyker's user avatar
8 votes
1 answer
5k views

YML For Enabling a Contrib Module

I am adding a contrib module to a project and I would like the module enabling to happen automatically on deployment. My deployment script pulls the code and runs a config update via drush config-...
Emanegux's user avatar
  • 621
8 votes
1 answer
2k views

What is the difference between the config and the settings directories?

I can see a folder named config in Drupal 8 core modules which contains sub directories like optional, schema and install. I can see it is like a settings folder which is initialised during module ...
Manikandan's user avatar
8 votes
2 answers
640 views

Best practice for custom module variable names?

I've gotten into the habit of doing pretty robust configuration panes for my modules now, and I'm finding the variable names & management to be quite the pain. I have variables like ...
electblake's user avatar
  • 2,067
8 votes
2 answers
483 views

Why is settings.php in the web folder?

In the default installation, settings.php is located at sites/default/. There are no recommendations in the official Drupal website about changing the location of this file. Doesn't it pose a ...
Cesar's user avatar
  • 942
8 votes
2 answers
1k views

Features versus Configuration Management

I am building a Drupal 8 site and I have done some research whenever I should use Configuration Management or Features to export configuration and include it in my profile. In order to export and ...
Tyler Durden's user avatar
  • 2,316
8 votes
2 answers
2k views

Configuration changes that will not import?

I have some configuration that will not import. If I run drush config-import --preview I see the changes to be imported; I hit 'y' to import. When I run the same command, the changes are still there? ...
dbj44's user avatar
  • 4,766
7 votes
3 answers
15k views

How do I export and import content types (including fields) between environments?

I've been trying to find a smart way of exporting content type and all its fields from one installation of Drupal to another. The core "Configuration synchronization" export only export the content ...
Jasper's user avatar
  • 173
7 votes
1 answer
2k views

When to use mapping or sequence to define an array in a schema file?

I need to define an array in my onlyone.settings.yml file to store this values: onlyone_node_types: book: book test: test In my onlyone.schema.yml file I have this: module.settings: type: ...
Adrian Cid Almaguer's user avatar
7 votes
1 answer
4k views

Does hook_install() get called before or after configuration yml files are loaded?

In Drupal 8, during module install, is hook_install() called before or after loading the .yml files in config/install? I've across a module that's using both (which seems like a bad idea on its own) ...
acrosman's user avatar
  • 2,738
7 votes
2 answers
5k views

How to enable modules through configuration?

I am trying to enable modules by adding them to core.extension.yml file without getting involved with Features, Configuration Installer or similar modules or profiles. The modules are enabled but ...
duru's user avatar
  • 599
7 votes
3 answers
3k views

Module uninstall dependencies

I'v got a question regarding dependencies & configuration. I created a module providing a content type, field type, widget & formatter. While wanting to uninstall the module, I get the ...
baikho's user avatar
  • 1,755
7 votes
3 answers
937 views

Overriding permissions selectively via settings.php/settings.local.php

The use case is a development module that you would only have installed on a local environment. My thought was to use $config in settings.php to do this: $config['user.role.anonymous']['permissions']...
star-szr's user avatar
  • 2,705
7 votes
3 answers
3k views

Config import conflict, how to remove lock

I am trying to import config on my staging site, and I repeatedly get the following message: Another request may be synchronizing configuration already. I know that there are no other processes ...
Duncanmoo's user avatar
  • 2,971

1
2 3 4 5
18