Here is the offending code from s \Drupal\entity\Tests\ContentTranslationWorkflowsTest::testWorkflows
foreach ($ops as $current_op => $label) {
$user = $this->drupalCreateUser(array($this->getTranslatePermission(), "$current_op content translations"));
$this->drupalLogin($user);
$this->drupalGet($translations_path);
foreach ($ops as $op => $label) {
if ($op != $current_op) {
$this->assertNoLink($label, format_string('No %op link found.', array('%op' => $label)));
}
else {
$this->assertLink($label, 0, format_string('%op link found.', array('%op' => $label)));
}
}
}
For only a moment it left my brain going what which $label is important here!!!
since the $label in the outer loop is unused.. I dont think it will alter the execution flow through the loops.
Comments
Comment #1
martin107 commentedComment #2
dawehnerYeah it indeed doesn't change the behaviour but nice small improvement.
Comment #3
martin107 commentedAhem, I found a small cluster of these untraversable nested foreach loop lurking in core ... is an easier mistake to make than you might think....
Comment #4
martin107 commentedComment #5
martin107 commentedComment #6
martin107 commentedd.o keeps mis-saving my related issues.. 4th time lucky
Comment #7
catchCommitted/pushed to 8.0.x, thanks!