[PP-2] Add validation constraints to book.settings

Created on 21 February 2024, 10 months ago
Updated 4 September 2024, 4 months ago

Problem/Motivation

The Book module's settings have 4 property paths that are not yet validatable:

$ vendor/bin/drush pm:install book
 [success] Successfully enabled: book
$ ./vendor/bin/drush config:inspect --filter-keys=book.settings --detail --list-constraints  --fields=key,validatability,constraints
➜  πŸ€– Analyzing…

 ------------------------------------------ ------------- ------------------------------------------ 
  Key                                        Validatable   Validation constraints                    
 ------------------------------------------ ------------- ------------------------------------------ 
  book.settings                              56%           ValidKeys: '<infer>'                      
   book.settings:                            Validatable   ValidKeys: '<infer>'                      
   book.settings:_core                       Validatable   ValidKeys:                                
                                                             - default_config_hash                   
   book.settings:_core.default_config_hash   Validatable   NotNull: {  }                             
                                                           Regex: '/^[a-zA-Z0-9\-_]+$/'              
                                                           Length: 43                                
                                                           ↣ PrimitiveType: {  }                     
   book.settings:allowed_types               NOT           ⚠️  @todo Add validation constraints here  
   book.settings:allowed_types.0             NOT           ⚠️  @todo Add validation constraints here  
   book.settings:block                       Validatable   ValidKeys: '<infer>'                      
   book.settings:block.navigation            Validatable   ValidKeys: '<infer>'                      
   book.settings:block.navigation.mode       NOT           ⚠️  @todo Add validation constraints here  
   book.settings:child_type                  NOT           ⚠️  @todo Add validation constraints here  
 ------------------------------------------ ------------- ------------------------------------------

Steps to reproduce

  1. Get a local git clone of Drupal core 11.x.
  2. composer require drupal/config_inspector β€” or manually install https://www.drupal.org/project/config_inspector/releases/2.1.5 β†’ or newer (which supports Drupal 11!)
  3. composer require drush/drush
  4. vendor/bin/drush config:inspect --filter-keys=book.settings --detail --list-constraints

Proposed resolution

  1. Add validation constraints.
  2. Mark FullyValidatable.

Remaining tasks

Review.

User interface changes

None.

API changes

None.

Data model changes

None.

Release notes snippet

N/A

πŸ“Œ Task
Status

Needs work

Version

2.0

Component
BookΒ  β†’

Last updated 6 days ago

  • Maintained by
  • πŸ‡ΊπŸ‡ΈUnited States @pwolanin
Created by

πŸ‡§πŸ‡ͺBelgium wim leers Ghent πŸ‡§πŸ‡ͺπŸ‡ͺπŸ‡Ί

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024