Hello All,
I am working on a module that will allow for the configuration of the advanced search form, i.e. which fields to show, which node types to to allow searching by etc.
In my settings function I am having a little trouble and can't seem to figure out why. variable_get
is behaving strangely. I have the following code which works as expected:
$form['search_config_disable_all'] = array(
'#type' => 'checkbox',
'#title' => t('Disable \'Advanced search\''),
'#default_value' => variable_get('search_config_disable_all', 0),
'#description' => 'Disable the entire advanced search form'
);
Now the following refuses to save the variable information:
$form['search_config']['keywords']['or'] = array(
'#type' => 'checkbox',
'#title' => t('Containing any of the words'),
'#default_value' => variable_get('search_config_disable_or', 0)
);
I have 3 other similar checkboxes that behave the same way.
If I do a form element with the following code:
$form['search_config']['keywords']['blah'] = array(
'#type' => 'checkbox',
'#title' => t('Just testing'),
'#default_value' => variable_get('blah', 0)
);
it works as expected.
This is not the first module I am developing but this is the first time I am encountering this issue. Am I just missing something very obvious? Maybe I've been looking at the code too long :).