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/comment/tests/src/Functional/CommentBlockTest.php, $block
variable never used.
Comment | File | Size | Author |
---|---|---|---|
#4 | unusedvariable.png | 565.71 KB | shetpooja04 |
#2 | unused_variable-3163685-2.patch | 776 bytes | shetpooja04 |
Comments
Comment #2
shetpooja04 CreditAttribution: shetpooja04 at QED42 commentedPlease Review
Comment #3
longwaveAs discussed in the parent issue we need to find out why this variable is left unused before this can be committed.
A useful tool for this is
git log -S “SOME TEXT”
which will search git commits for matching text to find out when the variable might have become unused. Without doing the work to show why the variable is unused the patch will not be committed. Alsogit blame
can be useful as well.Comment #4
shetpooja04 CreditAttribution: shetpooja04 at QED42 commentedCommit ID: 4462e204 Link: https://git.drupalcode.org/project/drupal/-/commit/4462e2046f389ccce499cfa54d644575488b40fa
File: core/modules/comment/lib/Drupal/comment/Tests/CommentBlockTest.php
Earlier the $block variable were used to fetch its label (Line 64 in screenshot)
It is no longer being used now
Comment #5
shetpooja04 CreditAttribution: shetpooja04 at QED42 commentedComment #6
longwaveThanks for researching this, I agree with your findings that we don't need this variable as it was only used to retrieve the block label and that is now hard coded.
Comment #8
catchCommitted 74ae4bd and pushed to 9.1.x. Thanks!