function social_private_message_install in Open Social 8.4
Same name and namespace in other branches
- 8.9 modules/social_features/social_private_message/social_private_message.install \social_private_message_install()
- 8 modules/social_features/social_private_message/social_private_message.install \social_private_message_install()
- 8.2 modules/social_features/social_private_message/social_private_message.install \social_private_message_install()
- 8.3 modules/social_features/social_private_message/social_private_message.install \social_private_message_install()
- 8.5 modules/social_features/social_private_message/social_private_message.install \social_private_message_install()
- 8.6 modules/social_features/social_private_message/social_private_message.install \social_private_message_install()
- 8.7 modules/social_features/social_private_message/social_private_message.install \social_private_message_install()
- 8.8 modules/social_features/social_private_message/social_private_message.install \social_private_message_install()
- 10.3.x modules/social_features/social_private_message/social_private_message.install \social_private_message_install()
- 10.0.x modules/social_features/social_private_message/social_private_message.install \social_private_message_install()
- 10.1.x modules/social_features/social_private_message/social_private_message.install \social_private_message_install()
- 10.2.x modules/social_features/social_private_message/social_private_message.install \social_private_message_install()
Implements hook_uninstall().
File
- modules/
social_features/ social_private_message/ social_private_message.install, line 13 - The Social Private Message (de)installation file.
Code
function social_private_message_install() {
_social_private_message_set_permissions();
// Disable the email notification provided by private_message.
/** @var \Drupal\Core\Config\Config|\Drupal\Core\Config\ImmutableConfig $config */
$config = \Drupal::getContainer()
->get('config.factory')
->getEditable('private_message.settings');
$config
->set('enable_email_notifications', FALSE)
->save();
$config
->set('send_by_default', FALSE)
->save();
// Set module weight.
module_set_weight('social_private_message', 1);
}