Commit 69c1608e authored by Sergey Shadrin's avatar Sergey Shadrin

[#124455] 10.3.x updated

-Enable some modules and sync configs from our profile
parent befce946
......@@ -4,6 +4,7 @@
* Install, update and uninstall functions for the profilename install profile.
*/
use Drupal\Core\Config\FileStorage;
use Drupal\node\Entity\Node;
/**
......@@ -24,3 +25,57 @@ function dar_install() {
\Drupal::configFactory()->getEditable('system.site')->set('page.front', '/node/' . $node->id())->save();
}
/**
* Update configs and install some new modules.
*/
function dar_update_10001(&$sandbox) {
$install_modules = [
'ban',
'better_exposed_filters',
'ckeditor5',
'csv_serialization',
'editor_advanced_link',
'field_group',
'flag',
'flood_control',
'honeypot',
'media_bulk_upload_dropzonejs',
'media_file_delete',
'menu_admin_per_menu',
'menu_link_content',
'menu_per_role',
'mobile_detect',
'optional_end_date',
'pathauto',
'select2',
'svg_image',
'taxonomy_access_fix',
'twig_attributes',
'twig_field_value',
'twig_tweak',
'views_aggregator',
'views_bulk_operations',
'xls_serialization',
];
\Drupal::service('module_installer')->install($install_modules);
$config_path = \Drupal::service('extension.list.module')->getPath('dar') . '/config/install';
$source = new FileStorage($config_path);
$config_storage = \Drupal::service('config.storage');
$configs_to_update = [
'editor.editor.full_html',
'editor.editor.basic_html',
'editor.editor.webform_default',
'filter.format.basic_html',
'filter.format.full_html',
'filter.format.plain_text',
'filter.format.restricted_html',
'filter.format.webform_default',
'filter.settings',
'media_file_delete.settings',
];
foreach ($configs_to_update as $config_to_update) {
$config_storage->write($config_to_update, $source->read($config_to_update));
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment