The for loop is not doing what the programmer intended.
Reported by a lint check in \Drupal\views_ui\Tests\DisplayFeedTest::checkFeedViewUi
The variable 'value' used by a foreach loop is already used in the same way by the outer foreach loop...
Expressed in my words "Ah rats I can't reuse $value again in the inner loop..."
foreach ($result as $value) {
foreach ($value->input->attributes() as $attribute => $value) {
if ($attribute == 'value') {
$options[] = (string) $value;
}
}
My fix is to introduce a local variable called $item, for the first use of $value.
Comments
Comment #1
dawehnerYeah why not.
Comment #2
martin107 commentedComment #3
catchCommitted/pushed to 8.0.x, thanks!