Problem/Motivation
Error using drush "skip" option values where id and title are different.
Using any of the skip option values of admin_permissions, fields, input_formats, or trusted_hosts encounters the following error
Error: Call to a member function getPluginId() on null in <path>/modules/contrib/security_review/src/Commands/SecurityReviewCommands.php on line 158 #0 [internal function]:
...
It appears that SecurityCheckPluginManager method getCheck attempts to match the id with the title.
https://git.drupalcode.org/project/security_review/-/blob/3.1.x/src/Secu...
In SecurityReviewCommands method getCheck the check_name is used as the title argument.
https://git.drupalcode.org/project/security_review/-/blob/3.1.x/src/Comm...
For these checks the title doesn't "match" the id.
Steps to reproduce
drush secrev --skip="trusted_hosts"
Issue fork security_review-3538772
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3538772-fix-skip
changes, plain diff MR !94
- 3538772-error-using-drush
changes, plain diff MR !84
Comments
Comment #2
joestewart commentedComment #3
joestewart commentedComment #5
joestewart commentedComment #6
smustgrave commentedGood time to maybe add test coverage for this plugin
Comment #7
smustgrave commentedDoes https://git.drupalcode.org/project/security_review/-/merge_requests/86/d... solve this?
May be unrelated but wanted to ask.
Comment #8
joestewart commentedIt does look similar but did not solve this issue in my quick testing.
Comment #9
joestewart commentedComment #13
smustgrave commentedI had to start a new MR because of a random conflict but got test coverage added. Not pretty but there