Problem/Motivation
Line 94, in the method body, not in a conditional block:
$entity = !empty($value->getParent()) ? $value->getEntity() : NULL;
Line 126:
if ($value->getParent() && ($entity = $value->getEntity()) && !$entity->isNew()) {
We've already determined $value->getParent() and assigned $entity in that case. So we can now just do:
if ($entity && !$entity->isNew())
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|
Issue fork drupal-3398400
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
pradhumanjain2311 commentedMade changes as requested.
Please review.
Comment #3
joachim commentedLooks good. Thanks!
Comment #4
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue.
While you are making the above changes, we recommend that you convert this patch to a merge request. Merge requests are preferred over patches. Be sure to hide the old patch files as well. (Converting an issue to a merge request without other contributions to the issue will not receive credit.)
Comment #7
sourabhjainComment #8
smustgrave commentedAs mentioned in another ticket(s)
Reroll to MR seems fine and since it was previously RTBC going to restore.
Comment #9
xjmAlso remember to hide the patch files when converting to an MR. Thanks!
Comment #13
xjmI had to read the code in the IS a couple times -- well spotted.
Crediting @joachim for the initial issue report, @pradhumanjain2311 for the patch, and @smustgrave for mentoring. Not crediting the MR conversion without other fixes, as per the above.
Committed to 11.x, 10.2.x, and 10.1.x as a code cleanup with no behavior or functionality change. Thanks!