message.install in Message 8
Same filename and directory in other branches
Install, update, and uninstall functions for the message module.
File
message.installView source
<?php
/**
* @file
* Install, update, and uninstall functions for the message module.
*/
/**
* Implements hook_uninstall().
*/
function message_uninstall() {
// Delete all message settings variables.
\Drupal::configFactory()
->getEditable('message.settings')
->delete();
}
/**
* Fixes the typo in 'adminster messages' permission.
*/
function message_update_8100() {
$entityTypeManager = \Drupal::service('entity_type.manager');
$roles = $entityTypeManager
->getStorage('user_role')
->loadMultiple();
foreach ($roles as $role) {
if ($role
->hasPermission('adminster messages')) {
$role
->revokePermission('adminster messages');
$role
->grantPermission('administer messages');
$role
->save();
}
}
}
Functions
Name | Description |
---|---|
message_uninstall | Implements hook_uninstall(). |
message_update_8100 | Fixes the typo in 'adminster messages' permission. |