-
Notifications
You must be signed in to change notification settings - Fork 0
/
soe_profile.profile
38 lines (33 loc) · 1015 Bytes
/
soe_profile.profile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
/**
* @file
* soe_profile.profile
*/
use Drupal\config_pages\ConfigPagesInterface;
use Drupal\Core\Installer\InstallerKernel;
/**
* Implements hook_install_tasks().
*/
function soe_profile_install_tasks(&$install_state) {
return ['soe_profile_final_task' => []];
}
/**
* Perform final tasks after the profile has completed installing.
*
* @param array $install_state
* Current install state.
*/
function soe_profile_final_task(array &$install_state) {
\Drupal::service('plugin.manager.install_tasks')->runTasks($install_state);
}
/**
* Implements hook_ENTITY_TYPE_presave().
*/
function soe_profile_config_pages_presave(ConfigPagesInterface $config_page) {
// During install, rebuild the router when saving a config page. This prevents
// an error if the config page route doesn't exist for it yet. Event
// subscriber doesn't work for this since it's during installation.
if (InstallerKernel::installationAttempted()) {
\Drupal::service('router.builder')->rebuild();
}
}