-
-
Notifications
You must be signed in to change notification settings - Fork 556
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[user:create] shows error when --roles is specified. #4133
Comments
ndouglas
added a commit
to ndouglas/drupal-console
that referenced
this issue
Aug 20, 2019
This prevents an error from being thrown when constructing the success message. See hechoendrupal#4133.
enzolutions
pushed a commit
that referenced
this issue
Sep 6, 2019
This prevents an error from being thrown when constructing the success message. See #4133.
enzolutions
pushed a commit
that referenced
this issue
Oct 10, 2019
* Update services.yml * Fix Travis tests * Update .travis.yml * Update .travis.yml * Update .travis.yml * Update .travis.yml * Update .travis.yml * Update .travis.yml * Update .travis.yml * Update .travis.yml * Update .travis.yml * Update .travis.yml * Update .travis.yml * Update .travis.yml * Update .travis.yml * Update .travis.yml * Update .travis.yml * 1 * Ensure $roles is an array when creating users. (#4134) This prevents an error from being thrown when constructing the success message. See #4133. * Generate revisional entity content is broken (#4139) * Add bundle permissions for content entity (#4138) * Add command option has-bundle-permissions and use on entity. * Add (Entity}Permissions.php file. * Add permission_callback to permissions.yml file. * Added fix from #4139 as it hurts. * Add own permissions checks. * Add --default option to database:add (#4143) This option allows to set the database as the default one instead of adding a new database in addition to the default one. See: #4142 * Update version to 1.9.3 (#4144) * Update version to 1.9.3 * Remove Module/InstallCommand::moduleRequirement * Remove
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Problem/Motivation
We see an error like this:
How to reproduce
Attempt to create a user with the following syntax:
drupal user:create <username> <password> --roles="<role>" --status=1 --no-interaction
Details to include:
Solution
It looks like the
roles
option isn't transformed into an array at any point if it is provided as an argument. However, increateUser
, after the user is created, the code assumes that the$roles
variable is an array and tries toimplode
it, which causes an error to be thrown while populating$result['success']
, which then results in a nasty backtrace.I'll submit a pull request here in a bit.
The text was updated successfully, but these errors were encountered: