Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: Views Bootstrap 5.5.4 — Minor update available for module views_bootstrap (5.5.4). Release: Rightup theme 1.0.3 — Minor update available for theme vartheme_bs5_rightup (1.0.3). Release: CommentOn 1.0.6 — Minor update available for module commenton (1.0.6). Release: ChatGPT Ads 1.0.3 — Minor update available for module chatgpt_ads (1.0.3). Release: Opensolr Search 5.1.3 — Minor update available for module opensolr_search (5.1.3). Release: ServiceM8 Webform Integration 1.2.1 — Minor update available for module servicem8_webform (1.2.1). Release: PostfixAdmin 1.0.0 — Initial release available for module postfix_admin (1.0.0)! Release: ip_analyser 1.0.3 — Minor update available for module ip_analyser (1.0.3). Module Revived: Swagger-PHP OpenAPI 3 documentation generator 1.0.0 — Module swagger_php updated after 10 months of inactivity (1.0.0). Security Coverage: Microsoft Azure AI — Module ai_provider_azure now has official Drupal security advisory coverage.

Rewrite existing configuration during installation

Place any configuration .yml in your module's config/rewrite folder and declare config_rewrite a dependency to your module. Full and partial configuration changes are saved on installation.

Example Config Rewrite

file://mysite/docroot/modules/my_module/config/rewrite/lightning_core.settings.yml

content_roles:
  creator:
    enabled: false
  reviewer:
    enabled: false

The above configuration will partially override lightning_core.settings configuration. This will happen after my_module is installed but before hook_install is run.

Example Config Replace (Full replacement)

file://mysite/docroot/modules/my_module/config/rewrite/system.site.yml

config_rewrite: replace
name: 'My Site'
mail: [email protected]
slogan: 'This site rules.'
page:
  0: ''
  1: ''
  front: /my-home
admin_compact_mode: false
weight_select_max: 100
langcode: en
default_langcode: en

The above configuration example will replace system.site entirely. The config_rewrite: value must be present at the top and set to replace -- this key/value pair will be stripped to retain config integrity before rewriting is completed.

Example Config Replace (specific keys only)

file://mysite/docroot/modules/my_module/config/rewrite/user.role.editor.yml

config_rewrite:
  replace: ["permissions"]
permissions:
  - 'change own username'

The above configuration example will replace only the designated keys. This is the most precise technique as it does not perform any array merging. If you are experiencing issues with the standard rewrite technique, consider adding an optional replace array to ensure the keys are rewritten correctly.

Some extra notes about overriding versus rewriting configuration files

This module came to be via working on Configuration Tools sub-module config_partial_override - which will actively override configuration at all times.

Configuration Rewrite (config_rewrite) only rewrites config during the extension's installation process.

If you want to actively override configuration, consider Configuration Override for full site overrides or Configuration Tools' Configuration Partial Override for module-based overrides.

Optional configuration is not supported by config_rewrite and attempting to rewrite config found in module's config/optional directory may lead to issues. We recommend using hook_install or traditional update hooks for those edge cases.

8.x-2.x dev version
The 8.x-2.x version that requires #2350111: Introduce an event to decouple the module installer from the entity manager is no longer under active development. We recommend using the stable 1.x releases going forward.

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
1
Tracked since
Jun 2024
Latest release
2 years ago
Releases (12 mo)
0
Maintenance
Dormant

Releases

Version Type Core Release date
8.x-1.6 Stable Jun 27, 2024