Problem/Motivation
The argument validator "None" (basic validator) contains $arg as a parameter, but it's not defined anywhere. I'm thinking it was supposed to be made $argument.
The $arg was added in #1788266-28: Access the different views related properties on the right object.
In that issue an error was made when moving code from function validate_argument_basic($arg) to Node::validateArgument($argument). The argument $arg is used in the original function and that codes was moved to the new method validateArgument. But now, in the new method there is no $arg and it was considered unused.
It was removed in #3316276: Fix 'undefined variable' PHPStan L0 errors in a PHPStan issue, which typically do not research the removals.
Steps to reproduce
Proposed resolution
Add a test
Change $arg to $argument
Remaining tasks
Review, specifically the added Test
Commit
User interface changes
N/A
API changes
N/A
Data model changes
N/A
Release notes snippet
N/A
| Comment | File | Size | Author |
|---|
Issue fork drupal-3029364
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:
Comments
Comment #2
andileco commentedComment #4
andileco commentedThe first time the tests ran, they failed, but the second time they passed.
Comment #5
nickdickinsonwildeI feel like fixing the variable name doesn't need an extra test, but some might disagree.
LGTM
Comment #6
alexpottWell we need test coverage here because it looks like we've never triggered this part of the if. So whatever it is there for is untested.
Comment #7
alexpottComment #12
quietone commentedI think this might be my first Views test.
Did some digging and found that $arg was added in 2012 to Views in a rather large patch. #1788266-28: Access the different views related properties on the right object
Comment #15
quietone commentedThe fail patch has an unexpected Drupal\KernelTests\Core\Entity\EntityAutocompleteTest::testSelectionSettingsHandling
The success patch has a failure in Drupal\Tests\quickedit\FunctionalJavascript\QuickEditFileTest::testRemove
Comment #19
quietone commentedConverted to an MR and restoring the removed variable that was considered unused.
Tagging for subsystem maintainer review to decide if $arg should be restored or not.
Comment #20
lendude@quietone I'm not 100% clear on what you are asking. Do you mean restoring the is_numeric check that used to use $arg? If so, then yes we should do that, like the MR is doing now. Or were you referring to something else?
Comment #22
longwaveComment #23
quietone commented@lendude. sorry to take so long. I was double checking if the name should be '$arg'. But you have confirmed that the change in the MR is correct.
Comment #24
lendude@quietone thanks for checking!
I that case I feel this is RTBC
Comment #25
alexpottI've backported this to 12.0.x, 11.x, and 11.5.x as a very low risk bug fix.
Committed and pushed c8ac3d260c9 to main and afd2bcb0f91 to 12.0.x and 4b320955ef4 to 11.x and e80115fc5da to 11.5.x. Thanks!