Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 295277

Add validation constraints to olivero.settings

$
0
0

Problem/Motivation

Olivero's settings have 3 property paths that are not yet validatable:

$ vendor/bin/drush config:inspect --filter-keys=olivero.settings --detail --list-constraints --fields=key,validatability,constraints
➜  🤖 Analyzing…

 ------------------------------------------------------------- ------------- ------------------------------------------ 
  Key                                                           Validatable   Validation constraints                    
 ------------------------------------------------------------- ------------- ------------------------------------------ 
  olivero.settings                                              83%           ValidKeys: '<infer>'                      
                                                                              RequiredKeys: '<infer>'                   
   olivero.settings:                                            Validatable   ValidKeys: '<infer>'                      
                                                                              RequiredKeys: '<infer>'                   
   olivero.settings:_core                                       Validatable   ValidKeys:                                
                                                                                - default_config_hash                   
                                                                              RequiredKeys: '<infer>'                   
   olivero.settings:_core.default_config_hash                   Validatable   NotNull: {  }                             
                                                                              Regex: '/^[a-zA-Z0-9\-_]+$/'              
                                                                              Length: 43                                
                                                                              ↣ PrimitiveType: {  }                     
   olivero.settings:base_primary_color                          NOT           ⚠️  @todo Add validation constraints here  
   olivero.settings:favicon                                     Validatable   ValidKeys: '<infer>'                      
                                                                              RequiredKeys: '<infer>'                   
   olivero.settings:favicon.use_default                         Validatable   ↣ PrimitiveType: {  }                     
   olivero.settings:features                                    Validatable   ValidKeys: '<infer>'                      
                                                                              RequiredKeys: '<infer>'                   
   olivero.settings:features.comment_user_picture               Validatable   ↣ PrimitiveType: {  }                     
   olivero.settings:features.comment_user_verification          Validatable   ↣ PrimitiveType: {  }                     
   olivero.settings:features.favicon                            Validatable   ↣ PrimitiveType: {  }                     
   olivero.settings:features.node_user_picture                  Validatable   ↣ PrimitiveType: {  }                     
   olivero.settings:logo                                        Validatable   ValidKeys: '<infer>'                      
                                                                              RequiredKeys: '<infer>'                   
   olivero.settings:logo.use_default                            Validatable   ↣ PrimitiveType: {  }                     
   olivero.settings:mobile_menu_all_widths                      NOT           ⚠️  @todo Add validation constraints here  
   olivero.settings:site_branding_bg_color                      NOT           ⚠️  @todo Add validation constraints here  
   olivero.settings:third_party_settings                        Validatable   ValidKeys: '<infer>'                      
                                                                              RequiredKeys: '<infer>'                   
   olivero.settings:third_party_settings.shortcut               Validatable   ValidKeys: '<infer>'                      
                                                                              RequiredKeys: '<infer>'                   
   olivero.settings:third_party_settings.shortcut.module_link   Validatable   ↣ PrimitiveType: {  }                     
 ------------------------------------------------------------- ------------- ------------------------------------------ 

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=olivero.settings --detail --list-constraints

Proposed resolution

Add validation constraints to:

  1. base_primary_color
  2. mobile_menu_all_widths
  3. site_branding_bg_color

This requires looking at the existing code and admin UI (if any) to understand which values could be considered valid. Eventually this needs to be reviewed by the relevant subsystem maintainer.

For examples, search *.schema.yml files for the string constraints:😊

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

Remaining tasks

  1. base_primary_color
  2. mobile_menu_all_widths
  3. site_branding_bg_color

User interface changes

None.

API changes

None.

Data model changes

More validation 🚀

Release notes snippet

None.


Viewing all articles
Browse latest Browse all 295277

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>