Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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,
Comment | File | Size | Author |
---|---|---|---|
#2 | 3093561-2.patch | 751 bytes | Krzysztof Domański |
Comments
Comment #2
Krzysztof DomańskiComment #3
oriol_e9gReally quick fix.
Comment #4
pifagor+1 to RTBC
Comment #5
drup16 CreditAttribution: drup16 as a volunteer commented+1 to RTBC
Comment #7
Krzysztof DomańskiUnrelated (media_library) random test failure.
Comment #11
catchCommitted/pushed to 9.0.x/8.9.x/8.8.x, thanks!