Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use JSON files for the default configuration values #45

Open
avpaderno opened this issue Jul 23, 2023 · 1 comment
Open

Use JSON files for the default configuration values #45

avpaderno opened this issue Jul 23, 2023 · 1 comment
Labels
postponed This is postponed on another issue task

Comments

@avpaderno
Copy link
Member

Some of the modules use code similar to the following one, to set the configuration values used by the module.

/**
 * Implements hook_install()
 */
function cron_example_install() {
  $config = config('cron_example.settings');
  $config->set('cron_example_interval', 60*60);
  $config->save();
}

Backdrop modules should use JSON files for the configuration default values and implement hook_config_info() to allow to Backdrop to remove those configuration values when the module is uninstalled.

At least the change should be done to show how to correctly use the Backdrop API. Example modules should not be installed on a production server; leaving some configuration values after the modules are uninstalled is probably a minor issue.

@avpaderno
Copy link
Member Author

I am postponing this issue on #79. Before using a .json file for the configuration default values, values that should not be configuration values need to be replaced by state values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
postponed This is postponed on another issue task
Projects
None yet
Development

No branches or pull requests

1 participant