Module deletes user.settings configuration

Created on 31 October 2024, about 2 months ago
/**
 * Implements hook_update_N().
 */
function min_password_update_8011() {
  $config = \Drupal::configFactory();
  $password_length = $config->get('user.settings')->get('password_length');
  if ($password_length) {
    $config->getEditable('min_password.settings')->set('password_length', $password_length)->save();
    $config->getEditable('user.settings')->clear('password_length')->delete();
  }

}

Last update deletes a user.settings. Without this config entity created by anonymous can't be edited, /config/people/account page doesn't work, email notifications not working etc.
Update must be $config->getEditable('user.settings')->clear('password_length')->save(); not ->delete();

πŸ› Bug report
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡¦Ukraine seonic

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024