Needs review
Project:
System User
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
24 May 2018 at 13:20 UTC
Updated:
24 Feb 2021 at 14:31 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
ckidowHere is my patch file to create a system user.
This patch is only for drush >= 9.
drush system_user:createor
drush system_user:create my@email.comComment #3
msankhala commentedMissing newline at end of file.
You can avoid this setter method by doing
$this->service = $system_user;inside constructor directly.Any advantage of doing setter injection here?
Comment #4
msankhala commentedComment #5
ckidowNo advantage from my point of view. Let's keep it simple and straight forward in the __construct as you suggested.
Comment #6
ckidowThere is a typo in the code doc for the "create" method:
"Creates a system users." -> Should be "Creates a system user."
Comment #7
ckidowPatch update
Comment #8
msankhala commentedThe patch applies cleanly but I am getting an error after applying this patch. Can you please provide interdiff as well? See https://www.drupal.org/documentation/git/interdiff
Runnding drush command gives this error. My drush version 9.3.0
Comment #9
lomasr commentedApplied the patch. It worked cleanly for me but after enabling the module. I tried the newly created drush cmd but got this error
The drush command 'system_user:create' could not be found. Run `drush cache-clear drush` to clear the commandfile cache if you have [error]
installed new extensions.
Comment #10
ckidow@lomasr As I mentioned above: This patch is only for drush >= 9 and module version 8.x.
Comment #11
ckidow@msankhala this error is because I created the patch against the 8.x-1.0 version ... not against the 8.x-dev version
I did this because I don't want to have the .install file including creating one new system_user on module install... that's what I don't want.
Comment #12
ckidowHere is the latest patch against current dev where the service class name was renamed.
Comment #13
ckidowThis should now work.
Comment #14
ckidowComment #15
ckidowComment #16
ckidowFinal version
Comment #17
ckidowComment #18
opdaviesComment #19
andrewtur commentedRerolled against dev. Added to drush commands drush system_user:makeAdmin and drush system_user:unmakeAdmin
Comment #20
andrewtur commentedRemoved php requirement from compose.json