Schema core.entity_form_mode.*.* should use string_parts to validatie ID instead of RegEx

Created on 1 September 2025, 30 days ago

Problem/Motivation

In the parent issue we introduced string_parts. Lets use that here to validate the id.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Feature request
Status

Active

Version

11.0 🔥

Component

other

Created by

🇳🇱Netherlands bbrala Netherlands

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

Comments & Activities

  • Issue created by @bbrala
  • 🇳🇱Netherlands bbrala Netherlands
  • 🇳🇱Netherlands bbrala Netherlands
  • 🇮🇳India Ishani Patel

    Hello @bbrala,

    Please check the code below and verify as I update those sections to use string_parts instead of string + regex:

    core.entity_view_mode.*.*:
      type: config_entity
      label: 'Entity view mode settings'
      mapping:
        id:
          type: string_parts
          label: 'ID'
          # View mode IDs are in the form: entity_type.view_mode
          part_types:
            - type: string
              label: 'Entity type'
              pattern: '^[a-z0-9_]+$'
            - type: string
              label: 'View mode'
              pattern: '^[a-z0-9_]+$'
    
    core.entity_form_mode.*.*:
      type: config_entity
      label: 'Entity form mode settings'
      constraints:
        FullyValidatable: ~
      mapping:
        id:
          type: string_parts
          label: 'ID'
          # Form mode IDs are in the form: entity_type.form_mode
          part_types:
            - type: string
              label: 'Entity type'
              pattern: '^[a-z0-9_]+$'
            - type: string
              label: 'Form mode'
              pattern: '^[a-z0-9_]+$'
    
    core.entity_view_display.*.*.*:
      type: config_entity
      label: 'Entity display'
      mapping:
        id:
          type: string_parts
          label: 'ID'
          # Display IDs are in the form: entity_type.bundle.view_mode
          part_types:
            - type: string
              label: 'Entity type'
              pattern: '^[a-z0-9_]+$'
            - type: string
              label: 'Bundle'
              pattern: '^[a-z0-9_]+$'
            - type: string
              label: 'View mode'
              pattern: '^[a-z0-9_]+$'
    
    core.entity_form_display.*.*.*:
      type: config_entity
      label: 'Entity form display'
      mapping:
        id:
          type: string_parts
          label: 'ID'
          # Form display IDs are in the form: entity_type.bundle.form_mode
          part_types:
            - type: string
              label: 'Entity type'
              pattern: '^[a-z0-9_]+$'
            - type: string
              label: 'Bundle'
              pattern: '^[a-z0-9_]+$'
            - type: string
              label: 'Form mode'
              pattern: '^[a-z0-9_]+$'
    

    Let me know your thoughts.

    Thanks!

  • 🇳🇱Netherlands bbrala Netherlands

    Hi! Thanks for working on this. I think we should try and find the reference from the parent as seen here: https://git.drupalcode.org/project/drupal/-/merge_requests/13004/diffs#c...

    That makes it actually dynamic, right now you just do the same, but then split in two which i think doesnt add much value.

Production build 0.71.5 2024