From b5866d8afc7ef985183ea1e5b0021c893e5a12e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Kalij=C3=A4rvi?= Date: Fri, 21 Feb 2025 13:49:04 +0200 Subject: [PATCH] UHF-11026: Updated the documentation of rewriting module configurations. --- documentation/development.md | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/documentation/development.md b/documentation/development.md index f0dbc5d6e..0392b4524 100644 --- a/documentation/development.md +++ b/documentation/development.md @@ -205,20 +205,7 @@ To update individual modules, run: `drush helfi:platform-config:update {module n #### Rewrite configuration -The `helfi_platform_config.config_update_helper` invokes `hook_rewrite_config_update`, which allows custom modules to react to config re-importing. - -##### In this example we would want to override Text paragraph label with a configuration found in my_module. - -To trigger the `hook_rewrite_config_update`, implement the hook to your `my_module.module`: -```php -function my_module_rewrite_config_update(string $module, Drupal\config_rewrite\ConfigRewriterInterface $configRewriter): void { - if ($module === 'helfi_paragraphs_text') { - // Rewrite helfi_paragraphs_text configuration. - $configRewriter->rewriteModuleConfig('my_module'); - } -} -``` -This hook will trigger when `\Drupal::service('helfi_platform_config.config_update_helper')->update('helfi_paragraphs_text');` is run, and it will search for configurations in `my_module/config/rewrite/` folder. +The `drush helfi:platform-config:update` command will automatically rewrite all custom module configurations which are added to `config/rewrite` folder. To override configurations for your Drupal instance, follow the instructions found in [Rewrite module project page](https://www.drupal.org/project/config_rewrite).