Add validation constraints to views.settings

Created on 15 April 2024, about 1 year ago
Updated 8 May 2024, about 1 year ago

Problem/Motivation

views.settings has property paths that are not yet validatable:

./vendor/bin/drush config:inspect --filter-keys=views.settings --detail --list-constraints                 
โžœ  ๐Ÿค– Analyzingโ€ฆ

 Legend for Data: 
  โœ…โ“  โ†’ Correct primitive type, detailed validation impossible.
  โœ…โœ…  โ†’ Correct primitive type, passed all validation constraints.
 --------------------------------------------------- --------- ------------- ------ -------------------------------------------- 
  Key                                                 Status    Validatable   Data   Validation constraints                      
 --------------------------------------------------- --------- ------------- ------ -------------------------------------------- 
  views.settings                                      Correct   31%           โœ…โ“   ValidKeys: '<infer>'                        
                                                                                     LangcodeRequiredIfTranslatableValues: null  
   views.settings:                                    Correct   Validatable   โœ…โœ…   ValidKeys: '<infer>'                        
                                                                                     LangcodeRequiredIfTranslatableValues: null  
   views.settings:_core                               Correct   Validatable   โœ…โœ…   ValidKeys:                                  
                                                                                       - default_config_hash                     
   views.settings:_core.default_config_hash           Correct   Validatable   โœ…โœ…   NotNull: {  }                               
                                                                                     Regex: '/^[a-zA-Z0-9\-_]+$/'                
                                                                                     Length: 43                                  
                                                                                     โ†ฃ PrimitiveType: {  }                       
   views.settings:display_extenders                   Correct   NOT           โœ…โ“   โš ๏ธ  @todo Add validation constraints here   
   views.settings:field_rewrite_elements              Correct   NOT           โœ…โ“   โš ๏ธ  @todo Add validation constraints here   
   views.settings:field_rewrite_elements.address      Correct   NOT           โœ…โ“   โš ๏ธ  @todo Add validation constraints here   
   views.settings:field_rewrite_elements.article      Correct   NOT           โœ…โ“   โš ๏ธ  @todo Add validation constraints here   
   views.settings:field_rewrite_elements.aside        Correct   NOT           โœ…โ“   โš ๏ธ  @todo Add validation constraints here   
   views.settings:field_rewrite_elements.blockquote   Correct   NOT           โœ…โ“   โš ๏ธ  @todo Add validation constraints here   
   views.settings:field_rewrite_elements.code         Correct   NOT           โœ…โ“   โš ๏ธ  @todo Add validation constraints here   
   views.settings:field_rewrite_elements.del          Correct   NOT           โœ…โ“   โš ๏ธ  @todo Add validation constraints here   
   views.settings:field_rewrite_elements.details      Correct   NOT           โœ…โ“   โš ๏ธ  @todo Add validation constraints here   
   views.settings:field_rewrite_elements.div          Correct   NOT           โœ…โ“   โš ๏ธ  @todo Add validation constraints here   
   views.settings:field_rewrite_elements.em           Correct   NOT           โœ…โ“   โš ๏ธ  @todo Add validation constraints here   
   views.settings:field_rewrite_elements.figure       Correct   NOT           โœ…โ“   โš ๏ธ  @todo Add validation constraints here   
   views.settings:field_rewrite_elements.footer       Correct   NOT           โœ…โ“   โš ๏ธ  @todo Add validation constraints here   
   views.settings:field_rewrite_elements.h1           Correct   NOT           โœ…โ“   โš ๏ธ  @todo Add validation constraints here   
   views.settings:field_rewrite_elements.h2           Correct   NOT           โœ…โ“   โš ๏ธ  @todo Add validation constraints here   
   views.settings:field_rewrite_elements.h3           Correct   NOT           โœ…โ“   โš ๏ธ  @todo Add validation constraints here   
   views.settings:field_rewrite_elements.h4           Correct   NOT           โœ…โ“   โš ๏ธ  @todo Add validation constraints here   
   views.settings:field_rewrite_elements.h5           Correct   NOT           โœ…โ“   โš ๏ธ  @todo Add validation constraints here   
   views.settings:field_rewrite_elements.h6           Correct   NOT           โœ…โ“   โš ๏ธ  @todo Add validation constraints here   
   views.settings:field_rewrite_elements.header       Correct   NOT           โœ…โ“   โš ๏ธ  @todo Add validation constraints here   
   views.settings:field_rewrite_elements.ins          Correct   NOT           โœ…โ“   โš ๏ธ  @todo Add validation constraints here   
   views.settings:field_rewrite_elements.kbd          Correct   NOT           โœ…โ“   โš ๏ธ  @todo Add validation constraints here   
   views.settings:field_rewrite_elements.p            Correct   NOT           โœ…โ“   โš ๏ธ  @todo Add validation constraints here   
   views.settings:field_rewrite_elements.pre          Correct   NOT           โœ…โ“   โš ๏ธ  @todo Add validation constraints here   
   views.settings:field_rewrite_elements.q            Correct   NOT           โœ…โ“   โš ๏ธ  @todo Add validation constraints here   
   views.settings:field_rewrite_elements.s            Correct   NOT           โœ…โ“   โš ๏ธ  @todo Add validation constraints here   
   views.settings:field_rewrite_elements.samp         Correct   NOT           โœ…โ“   โš ๏ธ  @todo Add validation constraints here   
   views.settings:field_rewrite_elements.section      Correct   NOT           โœ…โ“   โš ๏ธ  @todo Add validation constraints here   
   views.settings:field_rewrite_elements.span         Correct   NOT           โœ…โ“   โš ๏ธ  @todo Add validation constraints here   
   views.settings:field_rewrite_elements.strong       Correct   NOT           โœ…โ“   โš ๏ธ  @todo Add validation constraints here   
   views.settings:field_rewrite_elements.var          Correct   NOT           โœ…โ“   โš ๏ธ  @todo Add validation constraints here   
   views.settings:sql_signature                       Correct   Validatable   โœ…โœ…   โ†ฃ PrimitiveType: {  }                       
   views.settings:ui                                  Correct   Validatable   โœ…โœ…   ValidKeys: '<infer>'                        
   views.settings:ui.always_live_preview              Correct   Validatable   โœ…โœ…   โ†ฃ PrimitiveType: {  }                       
   views.settings:ui.exposed_filter_any_label         Correct   NOT           โœ…โ“   โš ๏ธ  @todo Add validation constraints here   
   views.settings:ui.show                             Correct   Validatable   โœ…โœ…   ValidKeys: '<infer>'                        
   views.settings:ui.show.additional_queries          Correct   Validatable   โœ…โœ…   โ†ฃ PrimitiveType: {  }                       
   views.settings:ui.show.advanced_column             Correct   Validatable   โœ…โœ…   โ†ฃ PrimitiveType: {  }                       
   views.settings:ui.show.default_display             Correct   Validatable   โœ…โœ…   โ†ฃ PrimitiveType: {  }                       
   views.settings:ui.show.display_embed               Correct   Validatable   โœ…โœ…   โ†ฃ PrimitiveType: {  }                       
   views.settings:ui.show.performance_statistics      Correct   Validatable   โœ…โœ…   โ†ฃ PrimitiveType: {  }                       
   views.settings:ui.show.preview_information         Correct   Validatable   โœ…โœ…   โ†ฃ PrimitiveType: {  }                       
   views.settings:ui.show.sql_query                   Correct   Validatable   โœ…โœ…   ValidKeys: '<infer>'                        
   views.settings:ui.show.sql_query.enabled           Correct   Validatable   โœ…โœ…   โ†ฃ PrimitiveType: {  }                       
   views.settings:ui.show.sql_query.where             Correct   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=views.settings --detail --list-constraints

Proposed resolution

Add validation constraints and mark FullyValidatable.

For examples, search *.schema.yml files for the string constraints: ๐Ÿ˜Š

Reach out to @borisson_ or @wimleers in the #distributions-and-recipes.

Remaining tasks

User interface changes

None.

API changes

Data model changes

More validation ๐Ÿš€

Release notes snippet

None.

๐Ÿ“Œ Task
Status

Active

Version

10.3 โœจ

Component
Viewsย  โ†’

Last updated about 10 hours ago

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia narendraR Jaipur, India

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