Open
Conversation
Member
|
Woops, I see there is a different Pr for 13.x at #6057 Needs to go into 13.x first |
NielsSluijs
reviewed
Jan 15, 2025
| $new_username = "'" . str_replace(array_keys($username_map), array_values($username_map), $options['sanitize-usernames']) . "'"; | ||
| } elseif ($db_driver === 'mssql') { | ||
| $username_map = ['%uid' => "' + uid + '"]; | ||
| $new_username = "'" . str_replace(array_keys($username_map), array_values($username_map), $options['sanitize-email']) . "'"; |
Contributor
There was a problem hiding this comment.
I think the $options['sanitize-email'] is a copy-paste error and should be replaced into $options['sanitize-usernames']
RaphTbm
reviewed
Nov 7, 2025
| #[CLI\Option(name: 'sanitize-usernames', description: 'Sanitize the names of users by replacing the originals with user+UID, or <info>no</info> to keep usernames unchanged.')] | ||
| #[CLI\Option(name: 'ignored-roles', description: 'A comma delimited list of roles. Users with at least one of the roles will be exempt from sanitization.')] | ||
| public function options($options = ['sanitize-email' => 'user+%[email protected]', 'sanitize-password' => null, 'ignored-roles' => null]): void | ||
| public function options($options = ['sanitize-email' => 'user+%[email protected]', 'sanitize-password' => null, 'sanitize-usernames' => 'user+%uid', 'ignored-roles' => null]): void |
There was a problem hiding this comment.
I'm not sure "+" is an allowed character for drupal username in the admin.
Maybe the default value in the command should be an underscore to avoid potential breaking?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4609 for projects on drush 12.x