Add validation constraints to book.settings
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3422862. -->
Reported by: [wim leers](https://www.drupal.org/user/99777)
Related to !6712 !52
>>>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<p>The Book module's settings have 4 property paths that are not yet validatable:</p>
<pre>$ vendor/bin/drush pm:install book<br> [success] Successfully enabled: book<br>$ ./vendor/bin/drush config:inspect --filter-keys=book.settings --detail --list-constraints --fields=key,validatability,constraints<br>➜ 🤖 Analyzing…<br><br> ------------------------------------------ ------------- ------------------------------------------ <br> Key Validatable Validation constraints <br> ------------------------------------------ ------------- ------------------------------------------ <br> book.settings 56% ValidKeys: '<infer>' <br> book.settings: Validatable ValidKeys: '<infer>' <br> book.settings:_core Validatable ValidKeys: <br> - default_config_hash <br> book.settings:_core.default_config_hash Validatable NotNull: { } <br> Regex: '/^[a-zA-Z0-9\-_]+$/' <br> Length: 43 <br> ↣ PrimitiveType: { } <br> book.settings:allowed_types NOT ⚠️ @todo Add validation constraints here <br> book.settings:allowed_types.0 NOT ⚠️ @todo Add validation constraints here <br> book.settings:block Validatable ValidKeys: '<infer>' <br> book.settings:block.navigation Validatable ValidKeys: '<infer>' <br> book.settings:block.navigation.mode NOT ⚠️ @todo Add validation constraints here <br> book.settings:child_type NOT ⚠️ @todo Add validation constraints here <br> ------------------------------------------ ------------- ------------------------------------------</pre><h4 id="summary-steps-reproduce">Steps to reproduce</h4>
<ol>
<li>Get a local git clone of Drupal core <code>11.x</code>.</li>
<li><code>composer require drupal/config_inspector</code> — or manually install <a href="https://www.drupal.org/project/config_inspector/releases/2.1.5">https://www.drupal.org/project/config_inspector/releases/2.1.5</a> or newer (which supports Drupal 11!)</li>
<li><code>composer require drush/drush</code></li>
<li><code>vendor/bin/drush config:inspect --filter-keys=book.settings --detail --list-constraints</code></li>
</ol>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<ol>
<li>Add validation constraints.</li>
<li>Mark <code>FullyValidatable</code>.</li>
</ol>
<h3 id="summary-remaining-tasks">Remaining tasks</h3>
<p>Review.</p>
<h3 id="summary-ui-changes">User interface changes</h3>
<p>None.</p>
<h3 id="summary-api-changes">API changes</h3>
<p>None.</p>
<h3 id="summary-data-model-changes">Data model changes</h3>
<p>None.</p>
<h3 id="summary-release-notes">Release notes snippet</h3>
<p>N/A</p>
> Related issue: [Issue #3421849](https://www.drupal.org/node/3421849)
> Related issue: [Issue #3395562](https://www.drupal.org/node/3395562)
> Related issue: [Issue #2920441](https://www.drupal.org/node/2920441)
> Related issue: [Issue #3402178](https://www.drupal.org/node/3402178)
> Related issue: [Issue #3413932](https://www.drupal.org/node/3413932)
> Related issue: [Issue #2952037](https://www.drupal.org/node/2952037)
issue