message-digest-update-common.php in Message Digest 8
Common upgrade data for the Message Digest module.
Contains database additions to drupal-8.bare.standard.php.gz that make sure the module and its dependencies exist.
File
tests/fixtures/update/message-digest-update-common.phpView source
<?php
/**
* @file
* Common upgrade data for the Message Digest module.
*
* Contains database additions to drupal-8.bare.standard.php.gz that make sure
* the module and its dependencies exist.
*/
use Drupal\Core\Database\Database;
$connection = Database::getConnection();
// Update core.extension to enable message_digest.
$extensions = $connection
->select('config')
->fields('config', [
'data',
])
->condition('collection', '')
->condition('name', 'core.extension')
->execute()
->fetchField();
$extensions = unserialize($extensions);
$extensions['module']['message'] = 0;
$extensions['module']['message_digest'] = 0;
$extensions['module']['message_notify'] = 0;
$connection
->update('config')
->fields([
'data' => serialize($extensions),
])
->condition('collection', '')
->condition('name', 'core.extension')
->execute();
// Install the message template entity type.
$connection
->merge('key_value')
->condition('collection', 'entity.definitions.installed')
->condition('name', 'message_template.entity_type')
->fields([
'value' => 'O:42:"Drupal\\Core\\Config\\Entity\\ConfigEntityType":41:{s:16:"