<p dir="auto">Hi,</p>
<p dir="auto">In the commit <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/symfony/symfony/commit/7e87eb1fdfac872687a4b9a7ce315812d5eb0d03/hovercard" href="https://github.com/symfony/symfony/commit/7e87eb1fdfac872687a4b9a7ce315812d5eb0d03"><tt>7e87eb1</tt></a>, which is fixing the request format when duplicating a <code class="notranslate">Request</code> object, you forcefully set the request format if the parent is already <code class="notranslate">null</code>.</p>
<p dir="auto">The thing is, when forwarding in a controller to another controller (or maybe something, I haven't tested for another case yet), you may need to let the request format be <code class="notranslate">null</code> and unbiased.</p>
<p dir="auto">Currently (brought by the commit <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/symfony/symfony/commit/7e87eb1fdfac872687a4b9a7ce315812d5eb0d03/hovercard" href="https://github.com/symfony/symfony/commit/7e87eb1fdfac872687a4b9a7ce315812d5eb0d03"><tt>7e87eb1</tt></a>), if the request format is null, then it is set to an arbitrary default which is <code class="notranslate">html</code>... Which renders useless any attempt to get the  "correct" request format in the forwarded controller, and the possibility to set a default.</p>
<p dir="auto">This is easily manageable by doing a little hack before the forward :</p>
<div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&lt;?php
use Syfmony\FrameworkBundle\Controller\Controller;

class MyController extends Controller
{
    public function myAction()
    {
        // ... stuff

        // little hack because of symfony/symfony's commit 7e87eb1fdf
        $request-&gt;getRequestFormat('json'); // json example. could be whatever except null

        $this-&gt;forward('Bundle:Action', ['param']);
    }
}"><pre class="notranslate"><span class="pl-ent">&lt;?php</span>
<span class="pl-k">use</span> <span class="pl-v">Syfmony</span>\<span class="pl-v">FrameworkBundle</span>\<span class="pl-v">Controller</span>\<span class="pl-v">Controller</span>;

<span class="pl-k">class</span> <span class="pl-v">MyController</span> <span class="pl-k">extends</span> <span class="pl-v">Controller</span>
{
    <span class="pl-k">public</span> <span class="pl-k">function</span> <span class="pl-en">myAction</span>()
    {
        <span class="pl-c">// ... stuff</span>

        <span class="pl-c">// little hack because of symfony/symfony's commit 7e87eb1fdf</span>
        <span class="pl-s1"><span class="pl-c1">$</span>request</span>-&gt;<span class="pl-en">getRequestFormat</span>(<span class="pl-s">'json'</span>); <span class="pl-c">// json example. could be whatever except null</span>

        <span class="pl-s1"><span class="pl-c1">$</span><span class="pl-smi">this</span></span>-&gt;<span class="pl-en">forward</span>(<span class="pl-s">'Bundle:Action'</span>, [<span class="pl-s">'param'</span>]);
    }
}</pre></div>
<p dir="auto">But still, I don't think this is what should be expected from the framework ; the request format, which is in my case handled by a view listener should be left as is and unbiased, even if it has a null value per default.</p>
<p dir="auto">So, maybe this commit was made from a need, but still, I think this could be a possible regression.</p>
<p dir="auto">Cheers.</p>
<p dir="auto">After my first typo since updating dependencies, I noticed fatal errors were displayed in a symfony layout, unfortunately I'm getting displaying issues.</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/fc5b7c9bfe00c2c6c7b1e7f23ccc815cfa23cdc95b3b528ed4fb7230e58f6569/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313230353338362f333636352f61633030333636362d343264622d313165322d396561322d3666306363633030303065662e706e67"><img src="https://camo.githubusercontent.com/fc5b7c9bfe00c2c6c7b1e7f23ccc815cfa23cdc95b3b528ed4fb7230e58f6569/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313230353338362f333636352f61633030333636362d343264622d313165322d396561322d3666306363633030303065662e706e67" alt="Capture du 2012-12-10 16:09:40.png" data-canonical-src="https://f.cloud.github.com/assets/1205386/3665/ac003666-42db-11e2-9ea2-6f0ccc0000ef.png" style="max-width: 100%;"></a></p>
<p dir="auto">The first issue occurs because I don't have xdebug installed, apparently it has only been tought for xdebug (<a href="http://easycaptures.com/fs/uploaded/737/5939488074.png" rel="nofollow">http://easycaptures.com/fs/uploaded/737/5939488074.png</a>).</p>
<p dir="auto">The second issue occurs because the register method of the ErrorHandler is called twice, I can't investigate on why now (but I don't touch it myself and don't have that many third party bundles installed, fostwitterbundle and genemubundle only), which causes the shutdown function being registered twice.</p>
<p dir="auto">A quick fix for the first issue could be to set display_errors to false on debug mode, as apparently all kind of errors would now be displayed by symfony anyway.</p>