All Questions
Tagged with configuration hooks
14 questions
2
votes
0
answers
51
views
How can I capture a field’s configs and storage so I can delete it and then re-create it?
I’m trying to implement this in a hook_update_N() but I’m not sure it’s proper (see excerpt below). Note I’m changing max_length in the process.
What I'm trying to do: update my_custom_entity....
2
votes
2
answers
1k
views
Create config object with array containing key-value pairs
We have a custom module, mymodule, that we want to use to create a config object for so that it can contain an array of key-value pairs. We need to be able to click button Add More on the form that ...
1
vote
1
answer
983
views
Link field is removing query parameters
We have an Article that a link field, field_link. When we create a new page of type Article, we set the link field to have a URL of www.example.com/somepath?someid=123345 and label of View. When the ...
0
votes
1
answer
1k
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 ...
0
votes
0
answers
754
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 ...
4
votes
1
answer
876
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 ...
2
votes
1
answer
2k
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 ...
0
votes
1
answer
472
views
Configuration variable inside a hook take always the default value in a PHPUnit test
I'm trying to create a Functional test for the dev version of the No Autocomplete module to test that if the configuration is set then an autocomplete attribute=off will be added to the password edit ...
1
vote
1
answer
260
views
How do I create a variable to check last time hook_cron() implemented from a custom module was ran?
We have a custom module for which we need to run on a daily basis. I am not sure it is working, as I am unable to store the time correctly.
Does the following code allow me to create a variable, ...
0
votes
1
answer
39
views
Accessing values entered in custom fields added to install_configure_form
In my installation profile, I have added a text field to the install_configure_form by including:
if (!function_exists("system_form_install_configure_form_alter")) {
function ...
9
votes
2
answers
841
views
Best way to delete all variables when uninstalling module
I'm writing a module that writes several variables (three, four variables for every content type, and other).
Which method should I use to delete them on hook_uninstall?
Is it safe to perform a ...
0
votes
1
answer
25
views
why doesn't system_menu() return the option I am expecting [closed]
If you go to this website: https://api.drupal.org/api/drupal/modules%21system%21system.module/function/system_menu/7
You will see what system_menu is supposed to output. My Drupal 7 has a jquery ...
2
votes
2
answers
719
views
Multi-site variables table for shared variables (extending variable_set)
I have a multi-site setup with some shared tables using db_prefix. The variables table is NOT shared. Sharing ALL variables would cause lot of trouble, but sharing only some selected variables wont.
...
2
votes
2
answers
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 ...