Part of meta-issue #2002650: [meta, no patch] improve maintainability by removing unused local variables

File /core/modules/content_translation/content_translation.admin.inc

Line 282: Unused local variable $bundle
Line 320: Unused local variable $entity_type
Line 321: Unused local variable $bundle
Line 405: Unused local variable $bundle
Line 453: Unused local variable $id

Comments

beowulf1416’s picture

Assigned: Unassigned » beowulf1416
Pete B’s picture

Status: Active » Needs review
StatusFileSize
new2.39 KB

$entity_type was in use.

Here's a patch for the others.

areke’s picture

Issue summary: View changes
Issue tags: +Needs reroll

The patch doesn't apply anymore. It should be rerolled.

areke’s picture

Status: Needs review » Needs work
deneo’s picture

Status: Needs work » Needs review
StatusFileSize
new1.43 KB

patch

enhdless’s picture

Status: Needs review » Reviewed & tested by the community

Patch applies nicely.

xjm’s picture

Title: Remove Unused local variable $bundle from /core/modules/content_translation/content_translation.admin.inc » Remove Unused local variables from the content_translation module
Component: other » content_translation.module
Priority: Normal » Minor
Status: Reviewed & tested by the community » Needs review

Let's also check the rest of the module and confirm that there are no other unused local variables.

parthipanramesh’s picture

Status: Needs review » Reviewed & tested by the community

Good work!

linl’s picture

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 5: drupal_core-local_variable-2081151-5.patch, failed testing.

tim bozeman’s picture

Status: Needs work » Reviewed & tested by the community
Issue tags: -Novice, -Needs reroll
StatusFileSize
new2.16 KB

I rerolled the patch from #5. It had a merge issue on line 341 of content_translation.admin.inc

<<<<<<< HEAD
    $fields = array();
    foreach ($entity_settings as $bundle => $bundle_settings) {
=======
    foreach ($entity_settings as $bundle_settings) {
>>>>>>> Applying patch from issue 2081151 comment 5

So I changed it to

    $fields = array();
    foreach ($entity_settings as $bundle_settings) {

And set the status back to RTBC.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed to 8.x, minus the accidental default.settings.php hunk. :)

tim bozeman’s picture

:D Whoops!

Status: Fixed » Closed (fixed)

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