From f3972aeb5a54bd426f5c9dac03cdc3d63b80fa8b Mon Sep 17 00:00:00 2001 From: Rupert Jabelman Date: Wed, 31 Jul 2024 13:11:26 +0100 Subject: [PATCH 1/2] Adds new install step, which calls a new hook (hook_localgov_post_install), so modules can run tasks at the end of a site install. --- localgov.api.php | 16 ++++++++++++++++ localgov.profile | 26 ++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 localgov.api.php diff --git a/localgov.api.php b/localgov.api.php new file mode 100644 index 0000000..4febb03 --- /dev/null +++ b/localgov.api.php @@ -0,0 +1,16 @@ + [ + 'display_name' => t('Localgov post install'), + 'display' => TRUE, + ], + ]; +} + +/** + * This is an install step, added by localgov_install_tasks(). + * + * We use this step to call a hook to allow other localgov modules to set things + * up as part of the site installation process that they can't do in their + * install hooks. + */ +function localgov_post_install_task(): void { + \Drupal::moduleHandler()->invokeAllWith('localgov_post_install', function (callable $hook, string $module) { + $hook(); + }); +} From 73ea233575f0c9fc1ede57e9d34cb5df02d5582d Mon Sep 17 00:00:00 2001 From: Rupert Jabelman Date: Wed, 31 Jul 2024 14:11:40 +0100 Subject: [PATCH 2/2] Code style. --- localgov.api.php | 18 ++++++++++++++++-- localgov.profile | 1 - 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/localgov.api.php b/localgov.api.php index 4febb03..e5bb791 100644 --- a/localgov.api.php +++ b/localgov.api.php @@ -1,5 +1,15 @@