Allowed type with no allowed children causes exception
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3551842. -->
Reported by: [mdranove](https://www.drupal.org/user/3695874)
Related to !125 !124
>>>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<p>If you go to the book settings page, add a new allowed type, but do not select anything for the allowed children, save, and then try to save the settings page again, an exception is thrown.</p>
<h4 id="summary-steps-reproduce">Steps to reproduce</h4>
<p>On fresh d11 book 3.x install</p>
<p>Navigate to /admin/structure/book/settings.</p>
<ol>
<li>Under Allowed content types and their children, choose a new type, but do not select anything for the allowed child type.</li>
<li>Save.</li>
<li>Go back to the settings page.</li>
<li>Try to save again.</li>
<li>An exception is thrown.</li>
</ol>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<p>The problem is that "null" is being saved to the config for allowed child types but a string is expected.</p>
<h3 id="summary-remaining-tasks">Remaining tasks</h3>
<ul>
<li>Add validate() to settings form to check that each allowed content_type has a corresponding allowed child_type.</li>
<li>Add NotNull constraint to schema.</li>
<li>Add tests.</li>
<li>Add post update hook.</li>
</ul>
<h3 id="summary-ui-changes">User interface changes</h3>
<h3 id="summary-api-changes">API changes</h3>
<h3 id="summary-data-model-changes">Data model changes</h3>
issue