Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [configuration-management]

Managing configurations across environments is part of the configuration management.

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 ...
0
votes
1answer
119 views

How to write options lists with drush vset?

When we want to pin a variable for an environment, we'll set the value in the admin, then go look it up in the database, and copy the name and value into a bash or phing script, to insure that that ...
0
votes
0answers
17 views

Variable and domain_variable have stuffed up my menus

Variable and domain_variable modules fixed the front page issue, so I am now able to have two unique front pages. However, it has broken the main menus. I've had the original Main Menu displaying on ...
8
votes
4answers
21k 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 ...
2
votes
1answer
26 views

Is there a variable that keeps track of which pages are enabled or disabled in Page Manager?

I'm using the Features module and I'm tired of manually enabling/disabling pages (user_edit, user_view, etc.) Is there a variable that I can add to Strongarm to control this in code?
2
votes
1answer
49 views

How do you export configuration from configuration module

I need to include the configuration that I track in configuration modules into my install profile or however I will allow so that it will be initialised on install. How do I do this?
0
votes
2answers
265 views

D6 - Trying to display variable_get()s in a block

I am trying to display 4 variables in a custom block(created from my custom module). I am accessing the variables using variable_get('$myvariable', '0'). I am not able to display the array in the ...
1
vote
3answers
356 views

Exporting custom configurations from Drupal

After installing a Drupal7 site, I have made several configurations/customizations over time. Now I would like to export them somehow, in order to load them to another site. But the problem is that I ...
7
votes
2answers
949 views

Change .gitignore file for sites/default/files/config

I'm checking out the new configuration management module for Drupal 7. It's effectively a back-port of the new configuration management that's in D8, and looks like it's going to be a great ...
2
votes
4answers
2k views

Unable to save variable(s) from a custom form

I want to create a custom form with a few textfields and then use variable_set to save those textfields as variables. I am not able to save the variable with the code below. Question: I do not see ...
1
vote
0answers
181 views

How to use context module instead of panel module?

I am unable to set user permission on particular section of panel. For example I have used 3 column panel layout for particular page and want to set view permission to only one column out of three to ...
0
votes
0answers
415 views

Fatal Error: Undefined function variable_get();

I have this, $metrics = variable_get('rbi_metrics_list_settings',array());, I have used this in 3-4 pages. And when I put in another file, when I wanted to see what's inside of $metrics , it said ...
2
votes
1answer
165 views

Configuration Management Module Keeps Saying 'needs attention'

I've just started using the configuration module to keep my Drupal database in sync between my development and live environments. Documentation for this module is sparse, and I'm trying to understand ...
18
votes
1answer
709 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 ...
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), ...
1
vote
1answer
174 views

variable_get with prefix

It's there a chance to retrieve all key/value, stored in variable table, that have a prefix, using variable_get()? e.g: variable_get("prefix_*") Or I have to use db_select('variable')?
2
votes
3answers
2k views

From where does variable_get() get the first parameter?

function variable_get($name, $default = NULL) { global $conf; return isset($conf[$name]) ? $conf[$name] : $default; } From where does variable_get() get the first parameter?
0
votes
1answer
1k views

Variable_get question default value in form

So I am reading Drupal Development Pro 7 and have stumbled upon something I am a little bit unsure about to do with the variable_get function & form element. I understand it retrieves a stored ...
0
votes
0answers
1k views

How do I free a variable set using variable_set()?

I have used variable_get(), and variable_set() in my form search, but when I visit another page, and come to the module again, it shows the previous results. How can I free the variable at the time of ...
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 ...
0
votes
1answer
1k views

variable_get/set not working right

I am using drupal 6. I have a variable in a function which I saved with variable_set. I called variable_get in a different function and it keeps giving me the default. Why wont it save the variable? I ...
2
votes
1answer
1k views

Form API + Module: Nested default value variable_get doesnt behave the same as unnested variable_get

Heres the example code: function mymodule_form($form, &$form_state){ $form['nest'] = array( '#type' => 'fieldset', '#title' => t('Nested settings'), '#tree' =>...
2
votes
3answers
870 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
2answers
66 views

How can I get documentation on a variable listed in the Features UI provided by Strongarm?

When looking through the list of variables provided by Strongarm, there are several that sound like they might be useful to include but what they actually refer to is impossible to guess from the name ...
2
votes
0answers
1k views

How to optimize the unserialization of “variables” cache value

As we all know, the whole variable table is being cached in the drupal cache system and is being extracted into global $conf variable in each invoke. In one of our production site with the domain ...
1
vote
2answers
397 views

db_query to drupal variable

I have a the following query: function background_audio_file_query($path) { $result = db_query("SELECT uri FROM `file_managed` WHERE `filemime` = 'audio/mpeg' LIMIT 1 , 30", array(':...
2
votes
2answers
2k views

Using variable_get() in multiple places, without duplicating $default

When using variable_get() in multiple places, how should one avoid duplicating the $default values? define()? Or is there some built-in Drupal-specific mechanism I'm missing?
1
vote
1answer
420 views

Why doesn't variable_set() work in an installation profile?

I'm writing an installation profile, and I want to display some forms on some pages. The form below intended to set a variable at submission time. It does not work in the profile, but it works on an ...
7
votes
2answers
2k views

How to export translated variables settings in code?

In a custom module I define several configuration variables by implementing the Variable module's API. The module is part of a multilingual site project, so some of these variables should be ...
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
2answers
145 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.
2
votes
1answer
443 views

Correct Syntax for $conf to populate Varnish Control Terminal

This may be more a php question, but pertains to Drupal, so here goes: I'm trying to configure Varnish Control Terminal to use multiple hosts using settings.php. I have: $conf['...
5
votes
4answers
903 views

How to change Drupal settings programmatically, to simplify sharing of config changes?

I'm thinking specifically here of layout changes, such as: moving a block around, or when a new block is created and needs to be positioned, and shown or hidden on specific pages. Currently, when ...
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
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 ...
8
votes
2answers
602 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 ...