-
Notifications
You must be signed in to change notification settings - Fork 11.6k
Closed
Description
- Laravel Version: 5.5.37
- PHP Version: 7.1.6
- Database Driver & Version: MySQL 5.6.35
Description:
The changes introduced in #23388 break templates that loop over generators:
Exception(code: 0): Cannot traverse an already closed generator at ...
Steps To Reproduce:
In your view composer, or wherever the data for your view is prepared:
while ($someCondition) {
...
yield $results;
}
In your view:
@foreach ($results as $chunk) <<< This line throws the exception
@foreach ($chunk as $record)
...
@endforeach
@endforeach
The offending line looks like this in the compiled template:
<?php $__currentLoopData = $results; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $chunk): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
sinbino and rvanlaaksaktiperdana
Metadata
Metadata
Assignees
Labels
No labels