Questions tagged [configuration-management]

Managing configurations across environments is part of the configuration management.

Filter by
Sorted by
Tagged with
3
votes
1answer
162 views

How to pass negative values to config-set

It seems that we can't set negative values with config-set: drush cset block.block.myblock_name weight '-1' --format=string -y doesn't work
3
votes
1answer
2k views

variables table in D8?

What database table in Drupal 8 replaces variables table in Drupal 7? Where are the values of Configuration stored? example : $config->set('message', 'Hi')->save(); Where can I find value of ...
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 ...
3
votes
1answer
201 views

variable_del wildcard when uninstalling a module

I have lot of variables created in a module. Is there any wildcard when deleting variables using variable_del. Ex1: variable_del($key . '_campaign_text_*'); Ex2: variable_del($key . '_campaign_text_%'...
3
votes
4answers
7k views

Remove the strict warnings from being shown

I have a site using Drupal 6; after upgrading PHP to 5.4 , some strict warning appear. I set error_reporoting in settings.php with the following code, but I still see the E_STRICT warnings. ...
3
votes
1answer
362 views

I need a .schema.yml file when I create a new custom field?

I just read Create a custom field type and I can't find a lot of information about the .schema.yml file. So, I just create a custom field without the .schema.yml file and I see that if I add my custom ...
3
votes
3answers
566 views

How to know when to use $config or $settings overrides in settings.php?

I want to be able to disable certain options of modules on non-production environments. For example: Disable XMLSitemap from running Set "Read Only" mode for Search API indices to TRUE Set robots....
3
votes
2answers
2k views

Configuration Management is broken between two site environments, I have no idea how to fix it

I started working on a d8 site two weeks ago; there are two site environments: @dev and @staging, on different servers. I have been developing the site locally (adding views, pages etc.) and using the ...
3
votes
1answer
1k views

For settings.php $conf, how can I tell what a variable in Drupal 7 is named in Drupal 8?

This article explains that using $conf in settings.php works differently in Drupal 8 compared to Drupal 7: The settings.php file could contain environment level overrides. Just remember how we ...
3
votes
1answer
651 views

What are the alternatives to Features module in Drupal 8 [closed]

I am trying to export configurations from one Drupal site to other. This is not a one time operation, I will need to do this multiple times and Single Import, Simple Export is not an option as there ...
3
votes
2answers
890 views

How to set translated variables' values from settings.php (or similar)

When using the Variable translation module (part of the Internationalization suite), how can I set the value of a translated variable from the site's settings.php file ? Using the $conf in the ...
3
votes
1answer
858 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 ...
3
votes
1answer
607 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 ...
3
votes
1answer
614 views

Can a module install a content type optionally or conditionally?

I have a module which installs a number of different custom content types, each defined in a .yml file in config/install/. I install my module, and the content type appears and works normally, and I ...
3
votes
1answer
333 views

un-escaped _server variable in settings.php - bad idea right?

I recently started working for a new company hosting drupal sites that is using a switch statement within the settings.php for multiple environments. I am accustomed to using multi-site and am ...
3
votes
1answer
1k views

Adding external databases to settings.php using prefix

As per the comments in settings.php: /* * You can also use a reference to a schema/database as a prefix. This maybe * useful if your Drupal installation exists in a schema that is not the default *...
3
votes
2answers
140 views

Is it possible to update module provided configuration schema in an hook_update_N()?

So I have a custom module with a module.schema file, defining a configuration schema for that module, not talking about database/field schema. module.settings: type: config_object label: 'Settings ...
3
votes
1answer
373 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 ...
3
votes
1answer
326 views

How to access variables in a fieldset with variable_get

function bi_mx_enhancement_form($form, &$form_state) { $form['bi_mx_enhancement_government_ws'] = [ '#type' => 'fieldset', '#title' => t('Government Web Service Settings')...
3
votes
1answer
56 views

View a log of administration configuration changes for Drupal 7?

I'm working on a Drupal 7 site and we have multiple developers and administrators accessing the site. Many times when the site breaks I can't see what was changed previously and by whom. Is there a ...
3
votes
2answers
1k views

Custom Block in custom 404 node

I have a node. This node is set to be the 'Default 404 (not found) page' in admin/config/system/site-information I've got a custom block that I want to show within the node mentioned previous. I ...
3
votes
1answer
241 views

How do I manage core and module updates along with config management between environments?

I've set up a dev site, a test site, and a public site. Dev and Test are in two separate virtual machines (VLAD) and Public is on a shared Dreamhost account. I've successfully used the Configuration ...
3
votes
2answers
763 views

Why does simpletest report a missing schema for my Drupal 8 module?

My module is working as expected with the following settings, config and config export. But when I try to run tests, I get the following error. I'm not sure what is wrong. Drupal\Core\Config\...
3
votes
3answers
7k views

File upload error. Could not move uploaded file

I am getting this error while changing the logo of my site, i have tried changing the permission through hosting provider, added php_value safe mode 0 in .htaccess file and even added one file in ...
3
votes
2answers
2k views

variable_get() using “default value” with no reason in Pressflow 6

I'm currently having a problem with variable_get() that sometimes with no reason, returns the default value instead of the one from the database. I'm using memcached here (and the Drupal memcached ...
3
votes
1answer
791 views

Custom configuration forms: translation access denied

While creating custom configuration forms, I'm getting an access denied. But on the /translation page of the form only. Configuration form itself can be reached, filled and updated without problems. ...
3
votes
3answers
778 views

How to create a field with hook_update?

I want to create a field with hook_update in my module. I have the following code that creates the configuration for a field_link field: $module_path = drupal_get_path('module', 'my_module'); $...
3
votes
1answer
1k views

Module configuration translation

I cannot find any good examples on how to make a module configuration translatable. Could someone give me a starter example to build off with?
3
votes
3answers
910 views

How do I export my site structure?

Since Drupal 8 is days away from release, I've started experimenting with rebuilding my personal site on it. The one feature I am really looking forward to is configuration management in code. ...
3
votes
2answers
171 views

What's the “Best Practice” approach for disabling secure pages on local Dev? [closed]

Wondering what the "best practice" approach would be for disabling secure pages on local dev. I'm running a site on Acquia Cloud and have access to the environment variable AH_SITE_ENVIRONMENT and I ...
3
votes
2answers
3k views

How to add variables to $conf array?

To modify some default settings for the Feeds module, I need to set a variable in the $conf array. What is the right way to achieve this? I've tried adding it in the settings.php file (currently on ...
3
votes
0answers
302 views

Update schema.yml variable type: string to integer

I would like to update my module schema variable from string to integer. mymodule.settings: type: config_object label: 'Module settings' mapping: identity: type: string -> integer ...
3
votes
2answers
495 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']...
3
votes
5answers
257 views

How much time does it take to manage sites within a multisite architecture as compared to multiple single installs?

A service my company offers is similar to managed hosting where we help keep a server, Drupal, related modules, and backups up to date on behalf of clients who can't or don't want to do that in house, ...
2
votes
2answers
2k views

The best way to store drupal Configuration

I know three options to store the configurations: Use the UI and store the values into the variable table. Also you can store them in settings.php and use the $conf[''] array to store the ...
2
votes
2answers
3k views

Define multiple variables in a custom module using hook_variable_info()

Im using the Variable module and need to define a variable with the type "multiple" in my custom module. I've been googled whole my day searching for any documentation or just an example and haven't ...
2
votes
3answers
893 views

Default value to drupal variable

I have a piece of code that I want to have the default value be a variable, but I need to know how to set a default value if the variable is not set: $form['background_audio_height'] = array( '#...
2
votes
1answer
418 views

Drupal Local and Dev Database

I have a Drupal Environment that deploys to GitHub as well as my server. The only issue is I have local database credentials and server database credentials. For now when I do my merge/push, I have to ...
2
votes
1answer
5k views

How can I retrieve the value of variable I have defined in a config form from a Twig template?

I have a module in Drupal 8 to build a configuration form where I can set the value of a variable. But I don't know how to retrieve the value of that variable from the twig template. In Drupal 7 I ...
2
votes
1answer
280 views

In which table should I save the value of system_settings_form in Drupal 7?

I am using Drupal 7 and creating a form with some fields like position. function mycustom_form($form, &$form_state){ $form = array(); $form['position'] = array( '#type' => 'textfield', ...
2
votes
1answer
37 views

How to get translated field_storage_config

I need to programmatically set the translated values for several fields on a node. For that I would like to set their values in the fields field_storage_config. Adapted from another question's answer (...
2
votes
1answer
106 views

What is the deal with config collections?

When manipulating configuration yaml files in config/sync, I note that if you put files in subdirectories, and run drush config:import, the files in those subdirectories are denoted as belonging to a '...
2
votes
1answer
148 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 ...
2
votes
2answers
1k views

Is there a way with drush or console to delete all active config with a certain prefix?

I'm currently trying to migrate a site with drush migrate-upgrade --configure-only ... and copying the export migrate_plus.migration_*.yml into a custom module for tweaking. Now I want to enable that ...
2
votes
1answer
519 views

How can I exclude API keys, passwords, and so on from configuration management?

I am using Drupal 8 and drush cex to commit my configuration to my repository. However, I want to keep passwords and API keys out of the repository. How do I do that? (selectively exclude sensitive ...
2
votes
3answers
2k views

why “errors validating the config synchronization” when UUID's match?

I'm moving a d8 config from dev to stage and I have edited system.site so that the primary UUID on the stage system is identical to the dev system; and yet drush still reports: "There were errors ...
2
votes
1answer
887 views

Should the Drupal 8 sites/default/files/config folder be stored in git with its hash suffix?

New question title: "Should the sites/default/files/config folder be stored in git with it's hash suffix?" " Reason I ask this is that this might cause 2 issues: May be a hindrance when comparing ...
2
votes
3answers
228 views

What is good way to hide update.php file?

I will like to know what is the correct/better way to hide update.php file on the production server. Currently when you try to access update.php file, Drupal shows default access denied page with ...
2
votes
1answer
54 views

Is there anything like get_variable storage that doesn't get loaded every page?

I have a custom module and I want to store a long bit of text (~20kB). I was going to use variable_get but as I understand all vars accessed this way are loaded for every request, which is a memory ...
2
votes
6answers
63k views

Database error: Lost connection to MySQL server at 'reading initial communication packet'

this has driven me crazy, I just couldn't find out what is wrong with it. I moved my site onto a test directory under my domain '/drupal_test', I have transferred the database over, set up ...