Questions tagged [configuration-management]

Managing configurations across environments is part of the configuration management.

Filter by
Sorted by
Tagged with
2
votes
1answer
311 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 ...
1
vote
1answer
85 views

Trusted_host_patterns not working with domain

I'm working with a drupal 8 site and trying to get trusted_host_patterns working properly with the domain that I'm using, and no matter what combination of regex I try I can only get it to work with ...
0
votes
1answer
87 views

How can I iterate through all the key and value of configuration object

I have an admin setting form (Configuration form) called 'example.settings'. I can load the configuration using below code. $config = \Drupal::config('example.settings'); Is there a way to iterate ...
2
votes
1answer
361 views

Settings contains a dot which is not supported, but module gets enabled properly

I'm developing a search engine module for Drupal 8. On a clean new Drupal website, I can install it from the admin GUI, but when I enable it I have the classical white screen (The website ...
0
votes
1answer
389 views

How to remove field from form and configuration?

We have a custom module, mymodule that has a form, mymoduleForm with two fields: enabled content types and urls. We no longer need the enabled content types field on the form and want to remove it ...
5
votes
2answers
1k 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 ...
1
vote
0answers
201 views

Add permission to existing role in custom module using configuration

Permissions may be added to existing roles programatically as described in this answer. However, I would like to put that into configuration. I can create a role calling king by putting user.role....
8
votes
2answers
8k 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 ...
3
votes
1answer
251 views

Unexpected error during import . . . plugin does not exist error on drush config import

This is an issue I've had occasionally when trying to delete a plugin in a custom module. In this example, once a filter format filter plugin has been enabled it's impossible to remove. If you ...
0
votes
1answer
191 views

Theme shown without styles

I executed the config:import: import successfully, but now it seems that the theme settings are no longer found. The site is now seen as in the attached image How can I solve the problem? Note: I ...
4
votes
3answers
5k 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 ...
1
vote
1answer
323 views

Optional configuration and order of enable modules on profile

I have a bug or a misconfiguration I don't understand. I'm creating a profile to create new web sites with an advance configuration quickly. But I meet a bug during installation with dependencies of ...
5
votes
1answer
743 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 ...
1
vote
1answer
187 views

How to extend block.block.* schema configuration file

Someone know how to exend this schema located in block module in core, to add a new data type in mapping from my custom module? The point is that I need to add a Boolean field for all the blocks in ...
-1
votes
2answers
84 views

Create a setting.*.php file for every stage of the website

I understand that my question could be opition-based and that it depends on the comfort of every drupal developer so please do not flag it as so ! For every Drupal 8 website i start, i use the below ...
4
votes
1answer
507 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 ...
0
votes
1answer
37 views

Two sites, same codebase mystery

Ubunutu Server, two Drupal sites. One dev and one live. Both domain names take you to the same code and database, the ones correct for the live site. Checked apache virtual host files. Both the dev ...
3
votes
2answers
4k views

How to test if memcache is working?

After successfully enabling it, how do you know it's working? And how do you know how much better performance is increased? In homepage of https://www.drupal.org/project/memcache it says: A module ...
0
votes
1answer
429 views

Drupal::config to access Site default timezone

Like the title says, I want to access the sites default timezone. Guess Drupal::config('system.date')->get('timezone')['default'] is the right function. I really would love to know how to use ...
0
votes
1answer
84 views

Is it possible to get original configuration when another Config Split is activated? (CONDITIONAL SPLIT is used)

I have dev and prod environments. I use payment getaway. There are different api keys for dev and prod envs, it's like test and live mode of the payment method. There is active dev config split ...
0
votes
2answers
542 views

Problem with remote sync because of wrong UUID

I have a problem with syncing my config to the remote server with Drupal 8. When I pull everything with GIT, and use drush to update the config via drush cim I get the following error: Attempt to ...
2
votes
1answer
109 views

Where are config dependencies stored?

I have this error when importing a single piece of config manually: Configuration foo.api depends on the MODULE extension that will not be installed after import. There is no "MODULE" extension in ...
0
votes
1answer
26 views

Is there a way to search Drupal's and contrib modules configuration settings?

With so many different modules in use with configuring Drupal it is hard to keep track of which settings are configured where, such as whether some CSS is set by the Code per Node or CSS Injector. It ...
0
votes
1answer
50 views

What core configurations should be used in settings.php for a production site? [closed]

Can someone please share Drupal core configurations that should be included and/or excluded from settings.php to make the site both performant and secure?
1
vote
1answer
457 views

Missing Schema on custom field only during PHPUnit Test

I have a custom field setup that I created similar to this tutorial. I exported all my fields on my node to a test module and enable it during my PHPUnit test. I run my test with the following ...
0
votes
1answer
195 views

Issues migrating site config at various points in project lifecycle

Issues migrating site config at various points in project lifecycle Hi My team and I have begun a new project for our company using the very latest version of Drupal 8 (version 8.5.6) We wanted to ...
0
votes
0answers
163 views

How to delete configurations when module is uninstalled?

We have a custom module mymodule that has the following structure. It basically has a configuration object that we are using in a mymodule_preprocess_node() call to do some logic and display certain ...
1
vote
0answers
133 views

Properly export text format and editor settings

I'm trying to export the CKeditor settings and restricted_html settings but it's partially imported in the end. I'm exporting the editor.editor.restricted_html.yml and the filter.format....
3
votes
1answer
389 views

When to create schema while working with config entity?

We have a custom form mymoduleForm.php that is used to perform some logic by calling mymodule_preprocess_node(). We were able to add addCacheableDependency() and now the mymodule_preprocess_node hook ...
0
votes
1answer
1k views

I have the following errors in my configuration page

I uninstalled a few modules. ~/apps/drupal/htdocs/modules$ drush pm-uninstall relaxed The following extensions will be uninstalled: relaxed Do you really want to continue? (y/n): y ...
0
votes
2answers
76 views

Remove Configuration Management Destination

I'm using drush cex or drush cim to export and import configuration on D8 site. Every time I run those commands, I get asked a question to select option for cancel, sync or staging, which is quiet ...
1
vote
1answer
699 views

How to clear cache for config entity after making changes?

We have a custom form mymoduleForm that has mymodule.settings which stores some values that we need to run some logic when calling mymodule_preprocess_node() hook. The form just has a text area where ...
1
vote
1answer
180 views

Edit a config variable of a custom module in controller

Is it possible to edit/create a config variable of a module in a controller created in the same module? For example: module_name/src/Controller/MyController.php: class MyController extends ...
0
votes
1answer
288 views

Error on config import - Field Collection

I am currently running into a config import error and it seems like it has something to do with field collections: Finalizing configuration synchronization. ...
0
votes
0answers
242 views

How to create a table in second database with hook_schema

I want to use two databases, that works following: How can I setup multiple database connections in Drupal 8? . I can set the connection in the settings.php file, access it by injecting a different ...
4
votes
3answers
321 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 ...
0
votes
0answers
87 views

How can you unset entity view display component with config override?

I have an entity view display configuration where I would like to "unset" a component (one of the field). I implement the ConfigFactoryOverrideInterface with the right service configuration. Is there ...
20
votes
3answers
11k views

Import a single yml configuration file

Is it possible to import one single yml configuration file by specifying its path? Or a group of yml files contained in a specific module?
0
votes
0answers
111 views

system.site.yml not installing correct site settings

performing D8 install through a custom profile, added a system.site.yml like: name: 'Portal Manager' mail: cms-admin@example.com slogan: '' page: 403: '' 404: '' front: /user admin_compact_mode: ...
0
votes
1answer
163 views

How hide from menu content type Basic Page and Landing page

In Drupal 8, I tried to remove default Basic page and Landing page content types, but it have content related to them. So, my quick fix will to only hide those one from some user. I tried with ...
2
votes
2answers
294 views

Listing variable values using drush

I would like to list the values of certain variables using Drush in order to make sure they are in fact the variables that I intend to add to my feature. It seems that some variables are parents which ...
1
vote
0answers
36 views

Drupal 8 config yml differences due to ordering/positioning of elements

Got a really annoying thing related to config-import/export, due to the positioning of elements in the yml file the config never syncs between production server and development server. For example: ...
0
votes
0answers
29 views

DATABASE SQLSTATE SQLSTATE[HY000] [duplicate]

Today we tried to check our website but we found this error. I don't know what happened exactly. PDOException: SQLSTATE[HY000] [2002] No such file or directory in Drupal\Component\DependencyInjection\...
-2
votes
2answers
58 views

D7 site does not show well under https

I installed https on my server with certbot and let's encrypt.However site displays garbled under https, which I need for several reason, http requests are not redirected to https for that reason, but ...
2
votes
1answer
179 views

What is the difference between core.entity_form_mode and core.entity_form_display?

I'm trying to learn how to configure content types and form modes programmatically in Drupal 8. I've created the following using the UI: A content type named book A form mode for content, named foo A ...
0
votes
0answers
137 views

Add custom variable to page.tpl.php using custom module?

I found this solution here: https://www.drupal.org/forum/support/module-development-and-code-questions/2010-12-25/add-custom-variable-to-pagetplphp I created a module for give possibility to some ...
0
votes
1answer
37 views

Field without Used in data in Fields Report

I had several fields on content that had an empty Used in in /admin/reports/fields. Apart from being inelegant :-), it's a real problem because Views doesn't see them properly as belonging to content ...
0
votes
1answer
877 views

How to override “active configuration” when the theme is installing?

I have a theme that imports configuration when is installed. The problem is when the configuration is already there and is active. Unable to install MYTHEME, field.field.user.user.user_picture, ...
1
vote
0answers
719 views

“PluginNotFoundException” when saving a view

I download the backup of my front page view. Then I decide to remove it (using the UI) and then added back again using the configuration import. Then I try to edit that view and does not let me save ...
6
votes
2answers
4k views

How to override configuration from a file?

I have been playing a lot lately with an import configuration to Drupal 8. And I notice that all documentation show you how to edit value per value instead of overriding the entire config file. You ...