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/node/lib/Drupal/node/Tests/NodeFormButtonsTest.php
Line 64: Unused local variable $node
Comment | File | Size | Author |
---|---|---|---|
#4 | rename_variable-2080057-4.patch | 743 bytes | wouters_f |
#2 | drupal8.node-module.2080057-2.patch | 708 bytes | G2 |
Comments
Comment #1
G2 CreditAttribution: G2 commentedComment #2
G2 CreditAttribution: G2 commentedRemoved line 64.
Comment #3
SeyV CreditAttribution: SeyV commentedThis is not the right solution. The problem is $node should be $node_1. By removing this var the next test will always be successful because the $node_1, loaded earlier in the code, will not be reloaded.
Comment #4
wouters_f CreditAttribution: wouters_f commentedLike this?
Comment #5
SeyV CreditAttribution: SeyV commentedYes, I think this is ok.
Comment #6
SeyV CreditAttribution: SeyV commentedComment #7
alexpottRetitling as this is now a fix - nice catch.
Committed 33b448c and pushed to 8.x. Thanks!