Problem/Motivation

Undefined variable $terms in core/modules/taxonomy/tests/src/Functional/Views/TaxonomyIndexTidUiTest.php

for ($i = 0; $i < 3; $i++) {
  for ($j = 0; $j <= $i; $j++) {
    $this->terms[$i][$j] = $term = Term::create([
      'vid' => 'tags',
      'name' => "Term $i.$j",
      'parent' => isset($terms[$i][0]) ? $terms[$i][0]->id() : 0,
    ]);
    $term->save();
  }
}

Proposed resolution

--- a/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyIndexTidUiTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyIndexTidUiTest.php
@@ -71,7 +71,7 @@ protected function setUp($import_test_views = TRUE) {
         $this->terms[$i][$j] = $term = Term::create([
           'vid' => 'tags',
           'name' => "Term $i.$j",
-          'parent' => isset($terms[$i][0]) ? $terms[$i][0]->id() : 0,
+          'parent' => isset($this->terms[$i][0]) ? $this->terms[$i][0]->id() : 0,
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Krzysztof Domański created an issue. See original summary.

Krzysztof Domański’s picture

Status: Active » Needs review
Issue tags: +Quick fix
FileSize
751 bytes
oriol_e9g’s picture

Status: Needs review » Reviewed & tested by the community

Really quick fix.

pifagor’s picture

+1 to RTBC

drup16’s picture

+1 to RTBC

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 2: 3093561-2.patch, failed testing. View results

Krzysztof Domański’s picture

Status: Needs work » Reviewed & tested by the community

Unrelated (media_library) random test failure.

  • catch committed 472c813 on 9.0.x
    Issue #3093561 by Krzysztof Domański: Undefined variable $terms in...

  • catch committed 3d20d93 on 8.9.x
    Issue #3093561 by Krzysztof Domański: Undefined variable $terms in...

  • catch committed 90019e0 on 8.8.x
    Issue #3093561 by Krzysztof Domański: Undefined variable $terms in...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 9.0.x/8.9.x/8.8.x, thanks!

Status: Fixed » Closed (fixed)

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