Loading auto_username.module +2 −13 Original line number Diff line number Diff line Loading @@ -72,19 +72,8 @@ function auto_username_user_insert($account) { */ function auto_username_user_update($account) { if (\Drupal::config('auto_username.settings')->get('aun_update_on_edit')) { $new_name = \Drupal::service('auto_username.utilities')->autoUsernameGenerateUsername($account); // No point updating anything if the generated name was just the same. if ($account->name == $new_name) { return; } // Replace with generated username. Database::getConnection() ->update('users_field_data') ->fields(array('name' => $new_name)) ->condition('uid', $account->id()) ->execute(); $account->name = $new_name; // Same processing as for user insert. auto_username_user_insert($account); } } Loading Loading
auto_username.module +2 −13 Original line number Diff line number Diff line Loading @@ -72,19 +72,8 @@ function auto_username_user_insert($account) { */ function auto_username_user_update($account) { if (\Drupal::config('auto_username.settings')->get('aun_update_on_edit')) { $new_name = \Drupal::service('auto_username.utilities')->autoUsernameGenerateUsername($account); // No point updating anything if the generated name was just the same. if ($account->name == $new_name) { return; } // Replace with generated username. Database::getConnection() ->update('users_field_data') ->fields(array('name' => $new_name)) ->condition('uid', $account->id()) ->execute(); $account->name = $new_name; // Same processing as for user insert. auto_username_user_insert($account); } } Loading