ConfigInspectorItemForm::buildFormConfigElement() should use a type hierarchy instead of hardcoding form items for types

Created on 24 October 2023, 8 months ago
Updated 9 January 2024, 6 months ago

Problem/Motivation

Discovered while making tests run on Drupal 10.2 over at πŸ“Œ Adopt GitLab CI Fixed .

Drupal 10.2 added:

  1. type: langcode β†’
  2. type: machine_name β†’
  3. type: required_label β†’

Consequently, the hardcoded logic in \Drupal\config_inspector\Form\ConfigInspectorItemForm::buildFormConfigElement() that only supports a dozen or so types no longer works. And it has never worked for contrib-defined types.

Steps to reproduce

Use Config Inspector 2.1.5 on Drupal 10.2.x.

Proposed resolution

  1. Use a type hierarchy to determine appropriate form elements: required_label extends label which extends string.
  2. Bonus points: when installed, use Content Translation's config_translation_config_schema_info_alter() hardcoded improvements.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Needs work

Version

2.1

Component

Code

Created by

πŸ‡§πŸ‡ͺBelgium Wim Leers Ghent πŸ‡§πŸ‡ͺπŸ‡ͺπŸ‡Ί

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

Comments & Activities

  • Issue created by @Wim Leers
  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7
    last update 8 months ago
    3 pass
  • @wim-leers opened merge request.
  • Status changed to Needs work 8 months ago
  • πŸ‡§πŸ‡ͺBelgium Wim Leers Ghent πŸ‡§πŸ‡ͺπŸ‡ͺπŸ‡Ί

    A hard-coded work-around is available in the MR, but this really should implement the proposed resolution instead.

  • πŸ‡§πŸ‡ͺBelgium Wim Leers Ghent πŸ‡§πŸ‡ͺπŸ‡ͺπŸ‡Ί

    I was forced to introduce a subset of this in πŸ“Œ Make tests pass on Drupal 10.2 Fixed , for type: required_label.

    It's still not using the full type hierarchy though; it's just using class (BooleanData, StringData, etc.).

    So this issue remains relevant, but is less urgent now.

Production build 0.69.0 2024