There are some unused variables present in the Views UI module i.e. the variables are initialized but never used and we should fix it. Below is the list for the same:

core/modules/views_ui/tests/src/Functional/OverrideDisplaysTest.php
196 | WARNING | Unused variable $new_block_title.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

S_Bhandari created an issue. See original summary.

S_Bhandari’s picture

Issue summary: View changes
S_Bhandari’s picture

Added a patch for the same.

shaktik’s picture

Issue tags: +Novice

tagged to Novice.

S_Bhandari’s picture

Assigned: S_Bhandari » Unassigned
Status: Needs work » Needs review
joshua1234511’s picture

Reviewed the Patch #3
https://www.drupal.org/files/issues/2020-07-09/3157933-3.patch
Php 7.4 and Drupal core 9.1 3157933-3.patch

Works for me, No issue on the working.

narendra.rajwar27’s picture

Status: Needs review » Needs work
+++ b/core/modules/views_ui/src/Controller/ViewsUIController.php
@@ -120,7 +120,7 @@ public function reportPlugins() {
-      foreach ($row['views'] as $row_name => $view) {

There is no need to remove the key $row_name in looping.

S_Bhandari’s picture

Assigned: Unassigned » S_Bhandari
Issue summary: View changes

Working on it.

S_Bhandari’s picture

FileSize
834 bytes

Added a patch for the same.

S_Bhandari’s picture

Assigned: S_Bhandari » Unassigned
Status: Needs work » Needs review
joachim’s picture

Status: Needs review » Reviewed & tested by the community

LGTM.

alexpott’s picture

This has been an unused variable since all the way back to views 7.x-3.x. It was brought into core unused. It looks like a c&p from other test methods in the same class.

This fix is fine I think.

alexpott’s picture

Version: 9.1.x-dev » 8.9.x-dev
Status: Reviewed & tested by the community » Fixed

Committed and pushed 4e50d880e9 to 9.1.x and 537d8fae34 to 9.0.x and c98772f42a to 8.9.x. Thanks!

  • alexpott committed 4e50d88 on 9.1.x
    Issue #3157933 by S_Bhandari: Remove Unused variables from Views UI...

  • alexpott committed 537d8fa on 9.0.x
    Issue #3157933 by S_Bhandari: Remove Unused variables from Views UI...

  • alexpott committed c98772f on 8.9.x
    Issue #3157933 by S_Bhandari: Remove Unused variables from Views UI...

Status: Fixed » Closed (fixed)

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