node_title_validation.install in Node Title Validation 8
Same filename and directory in other branches
Node title validation install.
File
node_title_validation.installView source
<?php
/**
* @file
* Node title validation install.
*/
/**
* Converts node_title_validation_config config entity to node_title_validation.
*/
function node_title_validation_update_8001() {
$old_config = \Drupal::configFactory()
->getEditable('node_title_validation_config.node_title_validation_settings');
$new_config = \Drupal::configFactory()
->getEditable('node_title_validation.node_title_validation_settings');
$new_config
->set('node_title_validation_config', $old_config
->get('node_title_validation_config'));
$new_config
->save();
$old_config
->delete();
}
/**
* Implements hook_uninstall().
*/
function node_title_validation_uninstall() {
// Deleting the validation settings while uninstalling the module.
\Drupal::configFactory()
->getEditable('node_title_validation.node_title_validation_settings')
->delete();
}
Functions
Name | Description |
---|---|
node_title_validation_uninstall | Implements hook_uninstall(). |
node_title_validation_update_8001 | Converts node_title_validation_config config entity to node_title_validation. |