Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
In core/modules/search/tests/src/Functional/SearchBlockTest.php, $email
variable never used.
The variable was never used when this code was first committed so it can simply be removed.
Comment | File | Size | Author |
---|---|---|---|
#11 | 3173595-11.patch | 650 bytes | Pooja Ganjage |
#6 | removed-unused-variable-3173595-6.patch | 2.02 KB | meena.bisht |
#6 | Screenshot 2020-10-08 at 11.56.05 AM.png | 267.99 KB | meena.bisht |
#2 | email.png | 518.32 KB | shetpooja04 |
#2 | 3173595-2.patch | 653 bytes | shetpooja04 |
Comments
Comment #2
shetpooja04 CreditAttribution: shetpooja04 at QED42 commentedCommit ID: ce189a3f
Link: https://git.drupalcode.org/project/drupal/-/commit/ce189a3f752e15bdeb92f620cff7a1fc72b8de41
File: core/modules/search/tests/src/Functional/SearchBlockTest.php Line: 130
For Issue: https://www.drupal.org/project/drupal/issues/3067943 the variable is added but not used
Please review
Comment #3
ranjith_kumar_k_u CreditAttribution: ranjith_kumar_k_u at Zyxware Technologies commentedThe above patch applied successfully ,it removes unused variable $email in SearchBlockTest.php.RTBC
Comment #4
ranjith_kumar_k_u CreditAttribution: ranjith_kumar_k_u at Zyxware Technologies commentedComment #6
meena.bisht CreditAttribution: meena.bisht at QED42 for Drupal India Association commentedAdding patch Removing $email variable and doing additional changes as was came across while running phpcs attaching screenshot.
Comment #7
meena.bisht CreditAttribution: meena.bisht at QED42 for Drupal India Association commentedComment #8
sulfikar_s CreditAttribution: sulfikar_s at Zyxware Technologies commentedHi,
I've applied the patch on the #6 and it applied cleanly. The patch removes $email variable and also the drupal standards are fixed in the line 96 & 116 (of SearchBlockTest.php) as the array contents are properly splitted over mulitple lines.
RTBC.
Comment #9
sulfikar_s CreditAttribution: sulfikar_s at Zyxware Technologies commentedComment #10
quietone CreditAttribution: quietone as a volunteer commented@sulfikar_s, Welcome to Drupal! Nice clear description of what you did to review this issue.
All these changes are out of scope. The issue title and summary states that this issue is to remove an unused variable. Anything outside of that must be done in a separate issue. And coding standard fixes are usually done in bulk by type not on individual files.
And lets update the issue summary. Adding the information that is in #2 would save the reviewer from having to read the issue to find that information. And the screenshot isn't necessary, we all have editors and can look at the file.
Comment #11
Pooja Ganjage CreditAttribution: Pooja Ganjage at Asentech LLC commentedHi,
I am updating patch as per #10 comments.
Please review the patch.
Thanks.
Comment #12
Pooja Ganjage CreditAttribution: Pooja Ganjage at Asentech LLC commentedComment #13
Pooja Ganjage CreditAttribution: Pooja Ganjage at Asentech LLC commentedComment #15
Abhijith S CreditAttribution: Abhijith S as a volunteer and at Zyxware Technologies commentedApplied patch #11 on 9.2.x.It works fine
RTBC
Comment #16
jijojoseph_zyxware CreditAttribution: jijojoseph_zyxware as a volunteer and at Zyxware Technologies commentedThanks for researching this, I agree with your findings that we don't need this variable.
Patch#11 applied cleanly.
RTBC!!!
Comment #18
longwaveRandom fail. Also updated IS.
Comment #21
catchCommitted a33344f and pushed to 9.2.x. Thanks!