Skip to content
Snippets Groups Projects
Unverified Commit e4f5c03c authored by Alex Pott's avatar Alex Pott
Browse files

Issue #2998483 by longwave, iuana, tstoeckler, Eli-T: Remove config-editing...

Issue #2998483 by longwave, iuana, tstoeckler, Eli-T: Remove config-editing parts from demo_umami_install() in favor of exported configuration
parent a3270cd3
No related branches found
No related tags found
No related merge requests found
definitions:
contact__site_page:
enabled: true
menu_name: footer
parent: ''
weight: 0
expanded: false
use_admin_theme: true
uuid: ''
name: ''
mail: ''
slogan: ''
page:
403: ''
404: ''
front: /node
admin_compact_mode: false
weight_select_max: 100
langcode: en
default_langcode: en
langcode: en
status: true
dependencies: { }
id: anonymous
label: 'Anonymous user'
weight: 0
is_admin: false
permissions:
- 'access content'
- 'access site-wide contact form'
- 'search content'
- 'use text format restricted_html'
- 'view media'
langcode: en
status: true
dependencies: { }
id: authenticated
label: 'Authenticated user'
weight: 1
is_admin: false
permissions:
- 'access content'
- 'access shortcuts'
- 'access site-wide contact form'
- 'search content'
- 'use text format basic_html'
- 'view media'
anonymous: Anonymous
verify_mail: true
notify:
cancel_confirm: true
password_reset: true
status_activated: true
status_blocked: false
status_canceled: false
register_admin_created: true
register_no_approval_required: true
register_pending_approval: true
register: admin_only
cancel_method: user_cancel_block
password_reset_timeout: 86400
password_strength: true
langcode: en
......@@ -6,7 +6,6 @@
*/
use Drupal\user\Entity\User;
use Drupal\user\RoleInterface;
use Drupal\shortcut\Entity\Shortcut;
/**
......@@ -35,13 +34,6 @@ function demo_umami_requirements($phase) {
* @see system_install()
*/
function demo_umami_install() {
// Set front page to "node".
\Drupal::configFactory()->getEditable('system.site')->set('page.front', '/node')->save(TRUE);
// Allow visitor account creation with administrative approval.
$user_settings = \Drupal::configFactory()->getEditable('user.settings');
$user_settings->set('register', USER_REGISTER_ADMINISTRATORS_ONLY)->save(TRUE);
// Assign user 1 the "administrator" role.
$user = User::load(1);
$user->roles[] = 'administrator';
......@@ -51,17 +43,6 @@ function demo_umami_install() {
// menu links are valid.
\Drupal::service('router.builder')->rebuildIfNeeded();
// Enable the Contact link in the footer menu.
/** @var \Drupal\Core\Menu\MenuLinkManagerInterface $menu_link_manager */
$menu_link_manager = \Drupal::service('plugin.manager.menu.link');
$menu_link_manager->updateDefinition('contact.site_page', ['enabled' => TRUE]);
user_role_grant_permissions(RoleInterface::ANONYMOUS_ID, ['access site-wide contact form']);
user_role_grant_permissions(RoleInterface::AUTHENTICATED_ID, ['access site-wide contact form']);
// Allow authenticated users to use shortcuts.
user_role_grant_permissions(RoleInterface::AUTHENTICATED_ID, ['access shortcuts']);
// Populate the default shortcut set.
$shortcut = Shortcut::create([
'shortcut_set' => 'default',
......@@ -79,13 +60,6 @@ function demo_umami_install() {
]);
$shortcut->save();
// Allow all users to use search.
user_role_grant_permissions(RoleInterface::ANONYMOUS_ID, ['search content']);
user_role_grant_permissions(RoleInterface::AUTHENTICATED_ID, ['search content']);
// Enable the admin theme.
\Drupal::configFactory()->getEditable('node.settings')->set('use_admin_theme', TRUE)->save(TRUE);
// Enable the demo content module. This can't be specified as a dependency
// in the demo_umami.info.yml file, as it requires configuration provided by
// the profile (fields etc.).
......
......@@ -77,6 +77,9 @@ protected function assertDefaultConfig(StorageInterface $default_config_storage,
'filter.format.basic_html' => ['roles:', ' - authenticated'],
'filter.format.full_html' => ['roles:', ' - administrator'],
'filter.format.restricted_html' => ['roles:', ' - anonymous'],
// The system.site config is overwritten during tests by
// FunctionalTestSetupTrait::installParameters().
'system.site' => ['uuid:', 'name:', 'mail:'],
]);
}
else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment