Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adds/enables msqrole module #721

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 28 additions & 5 deletions localgov.install
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,17 @@ function localgov_install() {

// Set front page to /user.
// This is so there is a default accessible front page on first install.
\Drupal::configFactory()
->getEditable('system.site')
->set('page.front', '/user')
->save();
$system_site_config = $config_factory->getEditable('system.site');
$system_site_config->set('page.front', '/user')->save();

// Enable entity_usage for media by default.
$entity_usage_config = $config_factory->getEditable('entity_usage.settings');
$local_task_enabled_entity_types = $entity_usage_config->get('local_task_enabled_entity_types');
if (!in_array('media', $local_task_enabled_entity_types)) {
$local_task_enabled_entity_types[] = 'media';
$entity_usage_config->set('local_task_enabled_entity_types', $local_task_enabled_entity_types);
$entity_usage_config->save(TRUE);
}
}

/**
Expand Down Expand Up @@ -80,9 +87,25 @@ function localgov_update_9502() {
}

/**
* Enable msqrole module.
* Update existing sites to use entity_usage for media.
*/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit confused as to what's happened here?

This is still the MR for enabling some masquerade system?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ekes I think it was just the merge confict as the Update existing sites to use entity_usage for media PR went in first and they both originally used the same update hook number 9503.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actual change (move this to update 9504:

localgov/localgov.install

Lines 89 to 112 in 33c491c

/**
* Update existing sites to use entity_usage for media.
*/
function localgov_update_9503() {
if (\Drupal::service('module_handler')->moduleExists('entity_usage')) {
$config_factory = \Drupal::configFactory();
$entity_usage_config = $config_factory->getEditable('entity_usage.settings');
$local_task_enabled_entity_types = $entity_usage_config->get('local_task_enabled_entity_types');
if (!in_array('media', $local_task_enabled_entity_types)) {
$local_task_enabled_entity_types[] = 'media';
$entity_usage_config->set('local_task_enabled_entity_types', $local_task_enabled_entity_types);
$entity_usage_config->save(TRUE);
}
}
}
/**
* Enable msqrole module.
*/
function localgov_update_9504() {
if (!\Drupal::service('module_handler')->moduleExists('msqrole')) {
\Drupal::service('module_installer')->install(['msqrole']);
}
}

function localgov_update_9503() {
if (\Drupal::service('module_handler')->moduleExists('entity_usage')) {
$config_factory = \Drupal::configFactory();
$entity_usage_config = $config_factory->getEditable('entity_usage.settings');
$local_task_enabled_entity_types = $entity_usage_config->get('local_task_enabled_entity_types');
if (!in_array('media', $local_task_enabled_entity_types)) {
$local_task_enabled_entity_types[] = 'media';
$entity_usage_config->set('local_task_enabled_entity_types', $local_task_enabled_entity_types);
$entity_usage_config->save(TRUE);
}
}
}

/**
* Enable msqrole module.
*/
function localgov_update_9504() {
if (!\Drupal::service('module_handler')->moduleExists('msqrole')) {
\Drupal::service('module_installer')->install(['msqrole']);
}
Expand Down
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.