Skip to content
Snippets Groups Projects
Commit 1a76b2e4 authored by Tolga Özses's avatar Tolga Özses
Browse files

Issue #3470008 by nikathone, yospyn: 'username_reset' is not a supported key

parent 44c0fcc0
No related branches found
No related tags found
No related merge requests found
<?php
/**
* @file
* Contains install, update and uninstall functions for forgot_username.
*/
/**
* Implements hook_uninstall().
*/
function forgot_username_uninstall($is_syncing) {
$config = \Drupal::configFactory()->getEditable('user.settings');
$mail_config = \Drupal::configFactory()->getEditable('user.mail');
// Remove the unwanted configuration lines.
$config->clear('notify.username_reset');
$mail_config->clear('username_reset');
$config->save();
$mail_config->save();
}
......@@ -27,6 +27,20 @@ function forgot_username_help($route_name, RouteMatchInterface $route_match) {
}
}
/**
* Implements hook_config_schema_info_alter().
*/
function forgot_username_config_schema_info_alter(array &$definitions) {
$definitions['user.settings']['mapping']['notify']['mapping']['username_reset'] = [
'type' => 'boolean',
'label' => 'Notify of forgotten username',
];
$definitions['user.mail']['mapping']['username_reset'] = [
'type' => 'mail',
'label' => 'Username reset',
];
}
/**
* Implements hook_mail().
*/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment