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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

sergeypavlenko’s picture

Assigned: sergeypavlenko » Unassigned
Status: Active » Needs review
FileSize
637 bytes
andymartha’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
48.16 KB
79.87 KB

After 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.
2064271test1.png

2064271test2.png

sergeypavlenko’s picture

Hi Andy, Thanks for the review.

The method of "drupalGetNodeByTitle" searches and returns a node for further processingthis should not affect the code below.

alphawebgroup’s picture

just 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

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 56f9e47 and pushed to 8.x. Thanks!

Automatically closed -- issue fixed for 2 weeks with no activity.