Problem/Motivation

In review process for #2909366: Fix 'Drupal.Commenting.VariableComment.EmptyVar' coding standard I realized that $language in /core/modules/views/tests/src/FunctionalJavascript/GlossaryViewTest.php is actually never used and could be simple removed.

Proposed resolution

Remove $language var declaration.

Remaining tasks

User interface changes

API changes

Data model changes

Comments

zaporylie created an issue. See original summary.

zaporylie’s picture

Status: Active » Needs review
StatusFileSize
new1.04 KB

And here's a patch.

joelpittet’s picture

Status: Needs review » Reviewed & tested by the community

That's straight forward. Thanks @zaporylie.

xjm’s picture

Title: Cleanup unused variable » Unused local variable in GlossaryViewTest
xjm’s picture

Title: Unused local variable in GlossaryViewTest » Unused member variable in GlossaryViewTest

Looks like this was indeed added in a new test in #2600804: AJAXified glossary view arguments fail when Language URL detection enabled and didn't really seem to exist before then.

zaporylie’s picture

Yes, sorry, I should have mentioned that in IS.

  • xjm committed 8e03638 on 8.5.x
    Issue #2914677 by zaporylie: Unused member variable in GlossaryViewTest
    
xjm’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: +Needs followup

Alright, I checked and confirmed this isn't used anywhere. There's a few other tests that have a similar variable that is actually used.

In core/modules/taxonomy/tests/src/Functional/Views/TaxonomyTermViewTest.php, there's a similar local language variable that's saved and never used; it could be updated like this one is. I thought about whether we should do that in the same patch, but since the Glossary view one is a class member and could actually affect child tests on the off-chance there were any, I think it makes sense to have separate issues. I committed this one to 8.5.x only for that reason. We can add a followup for the Taxonomy view.

Thanks @zaporylie!

zaporylie’s picture

Status: Fixed » Closed (fixed)

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