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

File /core/modules/translation/lib/Drupal/translation/Tests/TranslationTest.php

Line 267: Unused local variable $translation_es

CommentFileSizeAuthor
#21 remove-unused-2080559-21.patch813 bytesconnorwk
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 71,856 pass(es). View
#19 drupal-core-remove-unused-local-variables-from-translation-module-2080559-19.patch7.14 KBeugenesia
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 64,798 pass(es). View
#14 drupal-core-remove-unused-local-variables-from-translation-module-2080559-14.patch7.44 KBInternetDevels
FAILED: [[SimpleTest]]: [PHP 5.4 MySQL] Unable to apply patch drupal-core-remove-unused-local-variables-from-translation-module-2080559-14.patch. Unable to apply patch. See the log in the details link for more information. View
#12 drupal-core-remove-unused-local-variables-from-translation-module-2080559-11.patch8.36 KBizus
PASSED: [[SimpleTest]]: [MySQL] 59,854 pass(es). View
#9 drupal-core-remove-unused-local-variables-from-translation-module-2080559-9.patch8.3 KBizus
PASSED: [[SimpleTest]]: [MySQL] 59,751 pass(es). View
#6 drupal-core-remove-unused-local-variables-from-translation-module-2080559-5.patch1.7 KBRajesh Ashok
PASSED: [[SimpleTest]]: [MySQL] 59,736 pass(es). View
#1 drupal-core-remove-unused-local-variable-2080559.patch987 bytesmrsinguyen
PASSED: [[SimpleTest]]: [MySQL] 58,393 pass(es). View
Members fund testing for the Drupal project. Drupal Association Learn more

Comments

mrsinguyen’s picture

Status: Active » Needs review
FileSize
987 bytes
PASSED: [[SimpleTest]]: [MySQL] 58,393 pass(es). View
parthipanramesh’s picture

Issue summary: View changes
Status: Needs review » Needs work

patch failed to apply..

xjm’s picture

Title: Remove Unused local variable $translation_es from /core/modules/translation/lib/Drupal/translation/Tests/TranslationTest.php » Remove unused local variables from the translation module
Component: other » translation.module

Let's also check for other unused local variables in the translation module.

xjm’s picture

Priority: Normal » Minor
Rajesh Ashok’s picture

Assigned: Unassigned » Rajesh Ashok
Rajesh Ashok’s picture

Status: Needs work » Needs review
FileSize
1.7 KB
PASSED: [[SimpleTest]]: [MySQL] 59,736 pass(es). View

Removed unused local variables in the content_translation module.

Rajesh Ashok’s picture

Assigned: Rajesh Ashok » Unassigned
izus’s picture

Status: Needs review » Needs work

there are some unused use statements.
will upload a patch within minutes

izus’s picture

Status: Needs work » Needs review
FileSize
8.3 KB
PASSED: [[SimpleTest]]: [MySQL] 59,751 pass(es). View

deleted some use statements that seems to be unused.
hopefully this goes green !

izus’s picture

+++ b/core/modules/content_translation/lib/Drupal/content_translation/Form/ContentTranslationDeleteForm.php
@@ -40,7 +40,6 @@ public function getFormId() {
-    $uri = $this->entity->uri('drupal:content-translation-overview');

This one wasn't realy meant, i'll fix it back

izus’s picture

Status: Needs review » Needs work
izus’s picture

Status: Needs work » Needs review
FileSize
8.36 KB
PASSED: [[SimpleTest]]: [MySQL] 59,854 pass(es). View

here it is again

id.medion’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll

The patch cannot be applied.

InternetDevels’s picture

Status: Needs work » Needs review
FileSize
7.44 KB
FAILED: [[SimpleTest]]: [PHP 5.4 MySQL] Unable to apply patch drupal-core-remove-unused-local-variables-from-translation-module-2080559-14.patch. Unable to apply patch. See the log in the details link for more information. View

Reroll attached.

InternetDevels’s picture

Issue tags: -Needs reroll

Removed tag "Needs Reroll"

eugenesia’s picture

Status: Needs review » Needs work
eugenesia’s picture

Issue tags: +Needs reroll

Patch in #14 couldn't be applied as content_translation_menu() was removed in the latest dev version of the module.

eugenesia’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
FileSize
7.14 KB
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 64,798 pass(es). View

Rerolled patch #14. Also verified with PhpStorm that the content_translation module doesn't have any unused variables or imported namespaces.

connorwk’s picture

Here at the Austin sprint.
Going to re-roll and review this.

connorwk’s picture

FileSize
813 bytes
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 71,856 pass(es). View

Ok so I made a new patch because I realized in the current patch that I was working on re-rolling there are a lot of use statements removed that are not used. This is good work but is out of the scope of this issue and should have a new issue made for it or be put in one already existing for it.
There was only one unused local variable in the content_translation module reported by phpStorm so I made a patch for that.
Should just need review and this issue should hopefully be RTBC.

sun’s picture

Status: Needs review » Reviewed & tested by the community

Agreed that the use statements are out of scope.

  • Commit aedaf11 on 8.x by alexpott:
    Issue #2080559 by izus, connork, eugenesia, InternetDevels, Rajesh Ashok...
alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed aedaf11 and pushed to 8.x. Thanks!

Status: Fixed » Closed (fixed)

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