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.
Part of meta-issue #2002650: [meta, no patch] improve maintainability by removing unused local variables
File /core/modules/system/lib/Drupal/system/Tests/Database/SelectOrderedTest.php
Line 30: Unused local variable $name_field
Line 51: Unused local variable $name_field
Line 82: Unused local variable $name_field
Comment | File | Size | Author |
---|---|---|---|
#8 | drupal8.other_.2080289-8.patch | 1.42 KB | pieterjd |
#3 | drupal8.other_.2080289-3.patch | 1.3 KB | pieterjd |
Comments
Comment #1
chertzogClosing as duplicate of #2080311: Clean up Drupal\system\Tests\Database\SelectTest.php
Comment #2
angel.hThis issue shouldn't have been closed - see https://drupal.org/node/2080311#comment-7909573.
Comment #3
pieterjd CreditAttribution: pieterjd commentedComment #5
pieterjd CreditAttribution: pieterjd commentedSince it is my first patch - I went to the workshop yesterday at DrupalCon Prague - I followed the guide and doublechecked the required removals. I would like to bring this patch to a good end, any suggestions to make this patch pass the test?
Comment #6
herom CreditAttribution: herom commented@pieterjd You shouldn't have removed the whole lines; just the declaration part:
$name_field =
. You should check to make sure the lines you remove don't have any effect in the code.Here, in the second case, the query is expected to have the name field (see
$expected
variable there), and the test fails without it.Comment #7
mcrittenden CreditAttribution: mcrittenden commented@pieterjd, if you're interested in following through with a patch, it's also useful to assign it to yourself via the "Assigned" field when updating it.
Comment #8
pieterjd CreditAttribution: pieterjd commentedComment #9
cosmicdreams CreditAttribution: cosmicdreams commented#8: drupal8.other_.2080289-8.patch queued for re-testing.
Comment #10
areke CreditAttribution: areke commentedThe patch correctly gets rid of the unused variables, and keeps the tests. The patch applies, so it looks good. Thank you!
Comment #11
xjmPlease combine this patch with #2080343: Remove Unused local variables from system module.