<p dir="auto">I've just updated to 2.3.5-DEV and now the forms containing checkboxes appear to be broken.</p>
<p dir="auto">In particular this commit <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/symfony/symfony/commit/ed837522af4fd2050aec4fafa9dd3366b30b465d/hovercard" href="https://github.com/symfony/symfony/commit/ed837522af4fd2050aec4fafa9dd3366b30b465d"><tt>ed83752</tt></a> seems to be the cause.</p>
<p dir="auto">If I add back the if (null === $value) return null; in src/Symfony/Component/Form/Extension/Core/DataTransformer/BooleanToStringTransformer.php everything is fine again.</p>
<p dir="auto">Am I missing something?</p>
<p dir="auto">Commit <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/symfony/symfony/commit/ed83752/hovercard" href="https://github.com/symfony/symfony/commit/ed83752"><tt>ed83752</tt></a> breaks form creations for new objects in some common circumstances:</p>
<p dir="auto">For example if Product has a boolean type property which is initially null, this form creation will instantly throw a TransformationFailedException.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$entity = new Product();
$form   = $this-&gt;createForm(new ProductType(), $entity);"><pre class="notranslate"><code class="notranslate">$entity = new Product();
$form   = $this-&gt;createForm(new ProductType(), $entity);
</code></pre></div>
<p dir="auto">Maybe the following part should not have been removed from BooleanToStringTransformer::transform:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="if (null === $value) {
    return null;
}"><pre class="notranslate"><code class="notranslate">if (null === $value) {
    return null;
}
</code></pre></div>
<p dir="auto">Minimal failing example:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$obj = new \stdClass();
$obj-&gt;boolProp = null;

$form = $this-&gt;createFormBuilder($obj)
    -&gt;add('boolProp', 'checkbox')
    -&gt;getForm();"><pre class="notranslate"><code class="notranslate">$obj = new \stdClass();
$obj-&gt;boolProp = null;

$form = $this-&gt;createFormBuilder($obj)
    -&gt;add('boolProp', 'checkbox')
    -&gt;getForm();
</code></pre></div>