Questions tagged [configuration-management]

Managing configurations across environments is part of the configuration management.

Filter by
Sorted by
Tagged with
5
votes
1answer
695 views

Prevent Development modules from being added to configuration management

We have modules that are only used for local development like Stage File Proxy. How would I prevent these modules from being added to the configuration management?
5
votes
2answers
293 views

How do you keep production site in synch with development site?

I've got a Drupal development site where I test everything (modules, configurations etc.) before implementing on the production site. As it is right now, I need to write everything I do on paper and ...
5
votes
2answers
2k views

Getting a better handle on APC Cache Bins / code for settings.php

I've got APC up and running on my VPS and have installed the APC module on my Drupal 7 site. I followed the documentation here and added this code to my settings.php file: $conf['cache_backends'] = ...
5
votes
2answers
670 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 ...
5
votes
1answer
662 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 ...
5
votes
1answer
2k views

Why variable_get() returns all values of checkboxes list, even if checkbox is not selected?

I have checkboxes list in system settings form: $form['mymodule_menu_perm_menus'] = array( '#type' => 'checkboxes', '#title' => t('Menus'), '#options' => menu_get_menus(TRUE), ...
5
votes
1answer
3k views

Will changing the value of $drupal_hash_salt in settings.php file break site

I was looking through a list of steps to take when there is a risk that your site has been hacked. It recommends changing the value of $drupal_hash_salt in settings.php. According to the inline ...
5
votes
4answers
4k views

Encrypting db password stored in settings.php

The db password in settings.php is stored as plain text. Is there any way to encrypt that password? My client says its a security risk even though the file permissions is as should.
5
votes
1answer
487 views

Notice: Undefined index: driver in Database::openConnection() when trying to connect to sqlite db

In one of my modules I try to connect to one SQlite DB to copy from it the info into my MySQL DB, however after creating the db info and trying to add them into the Drupal context, I get the error ...
5
votes
1answer
274 views

How to make all render caches update on a configuration override?

Short version: I am using a configuration override to override the site name. Changes are reflected in the HTML title, but not in the system branding block. Drupal keeps serving this block from the ...
5
votes
2answers
138 views

How do I correctly inform the system about my module's new config?

I'm working on a module that already comes with a config file in mymodule/config/install/mymodule.settings.yml, and I'm working on a new feature that requires its own set of configuration in mymodule/...
5
votes
1answer
867 views

How to configure settings.php for Drupal site with Varnish and CDN?

I am completely new to the back-end issues, so I would appreciate any detailed answers with explanation. We need to configure our settings.php file so that it works with Varnish and CDN. Currently, ...
4
votes
2answers
416 views

variable_get('var') VS $GLOBALS['conf']['var']

Let's say I set a variable in settings.php: $conf['var'] = foo; In my module or theme code, I can access this with either: variable_get('var'); or $GLOBALS['conf']['var']; Which is the preferred ...
4
votes
4answers
5k views

Saving values using variable_set through an array

I have used variable_set to save one value. How can I save multiple values through an array using variable_set?
4
votes
2answers
3k views

How can I programatically change the (D8 core) workflow state of an entity with Content Moderation?

I'm using Drupal 8.4-rc2. When you enable the Workflow and Content Moderation modules, you automatically get the Editorial Workflow as a demonstration. The states are as follows: Archived Draft ...
4
votes
2answers
927 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 ...
4
votes
4answers
4k 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. ...
4
votes
1answer
2k views

How to check if a database is set up in settings.php?

I am creating a module for Drupal 8. One of the requirements is that you first add a new database in settings.php. On the admin page, I want to check if the user did this step and show a warning if he ...
4
votes
3answers
4k 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 ...
4
votes
2answers
3k views

How to use wysiwyg text editor (text_format) in a system configuration form

I couldn't find any documentation or examples about this. The implementation is very problematic. Do you a means to do this? Problems While trying to create a system settings form with text_format ...
4
votes
1answer
2k 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 ...
4
votes
1answer
3k 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->...
4
votes
2answers
3k views

Does get_defined_vars() show variables defined in variable_set()?

I'm using Drupal 6, and I'm having problems retrieving a set of variables I set with variable_set() using variable_get(). I'm doing a dpr(get_defined_vars()) to see what's defined, and I don't see my ...
4
votes
3answers
318 views

Is it possible to hardcode views as part of the custom module to avoid `config/sync`?

I've exported views into the custom module using Drupal Console and config:export:view command, so they exist as part of the module in modules/custom/my_module/config/install (YAML files). After I've ...
4
votes
3answers
1k views

What are configuration entities used for?

I’m trying to wrap my head around D8 Configuration Entities (CFE). The concept of a Content Entity (CTE) seems easy – if you want an application that keeps the information for a CD music collection ...
4
votes
2answers
891 views

How to use settings.local.php with Drupal 7?

I couldn't find answer from previous questions nor drupal.org/pantheon.io. I don't know that how to get local Drupal to use settings.local.php? There isn't a settings.php if I clone the repo from ...
4
votes
1answer
2k 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) ...
4
votes
2answers
1k views

Add default image to image file programmatically

I am trying to add a default image to an image field in Drupal 8 using the configuration management interface (CMI). Normally once I have a field configured through the admin UI, I would then export ...
4
votes
1answer
605 views

Bandwidth Optimization options locked

I'm running a largely default Drupal 8.0.0-RC2 site. At /admin/config/development/performance the "Bandwidth Optimization" settings for "Aggregate CSS Files" and "Aggregate Javascript files" are ...
4
votes
5answers
1k views

Block error on CMI

I have two identical sites on Drupal 8 (A and B), on (A) I created a custom block(block/add), and then I export the configuration(drush config-export) and import this config on (B) (drush config-...
4
votes
1answer
4k views

Setting $cookie_domain variable for specific folder structure

During configuration of Ckeditor I have to setup the cookie domain variable. I have added my site in subfolder like www.example.com/mynewsitefolder, where www.example.com is my current and running ...
4
votes
1answer
1k views

Add Field to Custom Content Type Programatically

I'm trying to create a module that creates its own content types during installation. I understand that I need to use the Configuration API and the Entity API, but I'm having trouble adding Drupal-...
4
votes
1answer
846 views

Prevent directory permissions of sites/default from being protected in a local environment?

Drupal automatically changes the directory permissions of sites/default to 555 (i.e. read-only), which means that if I'm editing sites/default/settings.php, even if I've set the permissions for that ...
4
votes
1answer
757 views

When 'cron_safe_threshold' is set to 0 in settings.php, should the dropdown value on admin/config/system/cron be “Never”? or is it irrelevant?

I've installed Drupal 8.1.6. As Ultimate_Cron won't work on this site consistently or reliably, I've decided to just use Drupal's core cron, triggered externally (via /etc/crontab) rather than using ...
4
votes
2answers
370 views

Clean URLs with multi-site only with suffixes / sub-folders

In D7 Multisite, I'd like to use clean URLs. However, these sites share the same domain but have different folder names. For example, the login pages would are currently https://domain.ext/red/?q=...
4
votes
1answer
4k views

Does variable_get() first go to 'variable' table in the database or the $conf array in settings.php?

I can't tell from the source for variable_get() for Drupal 6 whether it first looks for something in the variable table in the database, or the $conf array in settings.php. Also, if I were to add ...
4
votes
1answer
497 views

Development with git branches/ gitflow and new modules

I wonder if somebody found a solution for the following issue related to Drupal 8 development with Git branches: You work on a new feature in a local feature branch for that you activate a ...
4
votes
1answer
129 views

Per entity settings storage (configuration / state / field)

Background : #2833770 : Save user configs to states Auto-logout saves the per-user settings using configuration API, which would obviously break with environment change and config deployment. The ...
4
votes
3answers
578 views

Installing / updating modules in multi-site environment

I am in the middle of configuring a Drupal 8 installation with multiple domains in a multi-site configuration. One thing that occurred to me, is if one domain/site updates a module, the other site ...
4
votes
1answer
256 views

Should drush configuration export automatically update core.extension.yml?

The Drupal 8 documentation seems to be lacking in regards to the core.extension.yml file, so I'm a little confused on the right way of updating it. Should drush be populating it on config export, or ...
4
votes
4answers
4k views

Memcache integration is not loaded

I'm trying to setup memcache on my drupal 7 site. I have a memcache server setup and working and I've used setsebool -P httpd_can_network_memcache 1 to allow apache to communicate with it. I've also ...
4
votes
1answer
77 views

Benefit of config entities over regular config entries?

In Drupal 8 it is possible to store configuration in "config entities". However, the same can also be achieved with non-entity config entries. E.g. one example for a config entity schema, from core....
4
votes
1answer
1k 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? ...
3
votes
3answers
2k views

Configuration override not work from settings.php

I add the following to the end of my settings.php $config['system.site']['name'] = 'Drupal 8 DEVELOPMENT'; When I run drush cget system.site name it still displays the old site name. Any idea why ...
3
votes
2answers
3k views

Setting base_url in a multidomain setup?

I have functionality that relies on having $base_url set in the settings.php file, but I have a multidomain site in order to keep languages separate. The sections of my site are www.mysite.com and ...
3
votes
1answer
193 views

How to copy view modes between content types in Drupal 8?

I've been doing my first Drupal 8 project, and a major pain point, when you have a site with 10 or more content types, is to copy a view mode to all the other content types after you set it up on one ...
3
votes
1answer
2k views

Are there any pitfalls pointing config sync to profile's config/install?

Is this good practice? I have pointed my config sync to: $config_directories['sync'] = 'profiles/PROFILENAME/config/install'; Experiments with drush cex have worked, allowing a cycle of UI changes, ...
3
votes
2answers
146 views

Where are Cache settings stored?

I assumed the settings from the function system_performance_settings were stored in variables, but couldn't figure out which.
3
votes
1answer
2k views

settings.php after migration

I transferred my files via FTP and database to a hosting service. I edited two files, settings.php and sites/default/settings.php whose content was originally the following. $databases = array ( '...
3
votes
1answer
422 views

Module's optional field config not imported on install

I've got a module which contains a config/optional folder which has the content: paragraphs.paragraphs_type.my_paragraph_id.yml field.field.paragraph.my_paragraph_id.field_my_field.yml field.storage....