Weird bug? bufferStart vs. version 5?
-
Servus Arno,
I encoutered a weird bug and would like to pick you brain. It started when I had set WP_DEBUG to false. When on true, it doesnt occur. It is an combination of my stack which uses Twig via https://github.com/level-level/Clarkson-Core/
I have selected Version 5 btw as settings, while with version 4 this behaviour doesn’t occur.
I disabled all plugins and enabled them to find the cullprit and this plugin trigger a White Screen of Death.
So I tracked it to a combination of “bufferStart” and “outputFooter” methods. Disabling the “bufferStart” fixed it, but looking at the content I had a feeling that aob_startwithout an “ob_end_flush” ever being called.
And there in the outputFooter I saw the check if not version 4 then just return void.
When I added a “ob_end_flush();” before that return it started working again.
I think it’s an combination of the way the Twig rendering is implemented, on “template_include in combination an exit().
So I understand that without the whole Clarkson / Twig rendering flow this bug would not occur, but am I correct that calling an “ob_end_flush” makes the code a bit more predictable compated to when you really on the “auto flush” of PHP when it finishes a loading a page?
I solved it myself by adding and “ob_end_flush” on the wp_footer action, but let me know if you consider fixing it in the plugin yourself.
Have a nice day!
You must be logged in to reply to this topic.