Closed dampfklon closed 5 years ago
My temporary fix for this is to edit ExportMenu.php and change line 774:
Yii::$app->end();
to
exit();
It seems to do the trick, though I know that $app->end()
is the proper way to terminate the application. Probably some event handlers try to send additional headers in $app->end()
:
https://github.com/yiisoft/yii2/blob/master/framework/base/Application.php#L638
Setting output_buffering = On
also works locally, but I'm not able to set it on my hosting account.
The same here. version 1.3.0.
I tried @mgrabow1 fix ( the exit();
) and it works again.
This was changed from exit
to Yii::$app->end
in last release to properly terminate the app. Need to review
Fixed with latest release.
Got this problem in 1.3.1 Yii 2.0.15.1.
ExportMenu used as widget in index.php view inside Pjax
<?= ExportMenu::widget([ ...
`An Error occurred while handling another error: yii\web\HeadersAlreadySentException: Headers already sent in C:...\vendor\kartik-v\yii2-export\src\ExportMenu.php on line 778. in C:\inetpub\phpsites\agencyreward\vendor\yiisoft\yii2\web\Response.php:366 Stack trace:
Still there is an error. The source of the event that the framwork go through the original action after the post then the gridview module handle the export.
yii\web\HeadersAlreadySentException: Headers already sent in C:....\project\vendor\kartik-v\yii2-export\src\ExportMenu.php on line 778. in C:...\project\vendor\yiisoft\yii2\web\Response.php:366 Stack trace:
Update to v1.3.2 and let know
Fix confirmed in 1.3.2, thanks kartik 👍, exit() the best.
Prerequisites
master
branch of yii2-export. (master is 1.3.0Steps to reproduce the issue
Error (always
Headers already sent
but depending on format different locations) :possibly related to https://github.com/yiisoft/yii2/issues/15782
Expected behavior and actual behavior
When I follow those steps, I see Exeption thrown
I was expecting no Error
Environment
Libraries