Add validation constraints to system.mail

Created on 15 April 2024, 7 months ago
Updated 17 July 2024, 4 months ago

Problem/Motivation

The System module's mail have 4 property paths that are not yet validatable:

vendor/bin/drush config:inspect --filter-keys=system.mail --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                                                       
 ---------------------------------------- --------- ------------- ------ ----------------------------------------------------------------------------- 
  system.mail                              Correct   67%           โœ…โ“   ValidKeys: '<infer>'                                                         
                                                                          LangcodeRequiredIfTranslatableValues: null                                   
   system.mail:                            Correct   Validatable   โœ…โœ…   ValidKeys: '<infer>'                                                         
                                                                          LangcodeRequiredIfTranslatableValues: null                                   
   system.mail:_core                       Correct   Validatable   โœ…โœ…   ValidKeys:                                                                   
                                                                            - default_config_hash                                                      
   system.mail:_core.default_config_hash   Correct   Validatable   โœ…โœ…   NotNull: {  }                                                                
                                                                          Regex: '/^[a-zA-Z0-9\-_]+$/'                                                 
                                                                          Length: 43                                                                   
                                                                          โ†ฃ PrimitiveType: {  }                                                        
   system.mail:interface                   Correct   NOT           โœ…โ“   โš ๏ธ  @todo Add validation constraints here                                    
   system.mail:interface.default           Correct   Validatable   โœ…โœ…   PluginExists:                                                                
                                                                            manager: plugin.manager.mail                                               
                                                                            interface: Drupal\Core\Mail\MailInterface                                  
                                                                          โ†ฃ PrimitiveType: {  }                                                        
   system.mail:mailer_dsn                  Correct   Validatable   โœ…โœ…   ValidKeys: '<infer>'                                                         
   system.mail:mailer_dsn.host             Correct   Validatable   โœ…โœ…   NotBlank:                                                                    
                                                                            message: 'The mailer DSN must contain a host (use "default" by default).'  
                                                                          โ†ฃ PrimitiveType: {  }                                                        
   system.mail:mailer_dsn.options          Correct   NOT           โœ…โ“   โš ๏ธ  @todo Add validation constraints here                                    
   system.mail:mailer_dsn.password         Correct   NOT           โœ…โ“   โš ๏ธ  @todo Add validation constraints here                                    
   system.mail:mailer_dsn.port             Correct   Validatable   โœ…โœ…   Range:                                                                       
                                                                            min: 0                                                                     
                                                                            max: 65535                                                                 
                                                                          โ†ฃ PrimitiveType: {  }                                                        
   system.mail:mailer_dsn.scheme           Correct   Validatable   โœ…โœ…   NotBlank:                                                                    
                                                                            message: 'The mailer DSN must contain a scheme.'                           
                                                                          โ†ฃ PrimitiveType: {  }                                                        
   system.mail:mailer_dsn.user             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=system.mail --detail --list-constraints

Proposed resolution

  1. Add validation constraints.
  2. Mark FullyValidatable.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

๐Ÿ“Œ Task
Status

Needs work

Version

10.3 โœจ

Component
Systemย  โ†’

Last updated 7 days ago

No maintainer
Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia kunal.sachdev

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

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024