Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Part of meta-issue #2002650: [meta, no patch] improve maintainability by removing unused local variables
File /core/modules/node/lib/Drupal/node/Tests/NodePostSettingsTest.php
Line 68: Unused local variable $node
Comment | File | Size | Author |
---|---|---|---|
#2 | 2064271test1.png | 79.87 KB | andymartha |
#2 | 2064271test2.png | 48.16 KB | andymartha |
#1 | drupal-2064271-1.patch | 637 bytes | sergeypavlenko |
Comments
Comment #1
sergeypavlenko CreditAttribution: sergeypavlenko commentedComment #2
andymartha CreditAttribution: andymartha commentedAfter applying the patch drupal-2064271-1.patch by sergeypavlenko in #1 to a Drupal 8 fresh install 8/12, the patch applied cleanly and removed the unused $node variable from the file. However, the first time I tried to edit a node after applying the patch, I received the following error message. I tried creating nodes and editing/saving them in a variety of content settings (leaving some off, changing the type of content, etc...) and couldn't reproduce, so I guess it was a fluke. Anything else, just ask.
Comment #3
sergeypavlenko CreditAttribution: sergeypavlenko commentedHi Andy, Thanks for the review.
The method of "drupalGetNodeByTitle" searches and returns a node for further processingthis should not affect the code below.
Comment #4
alphawebgroupjust checked
this improvement in the patch doesn't affect the main flow of content editing... because that unused variable was removed from the test flow...
so, rtbc is correct for this patch i believe
Comment #5
alexpottCommitted 56f9e47 and pushed to 8.x. Thanks!