Make 'sequence' Typed Data instances return type of 'sequence' instead of 'list'

Created on 17 May 2023, over 1 year ago
Updated 23 July 2023, over 1 year ago

Problem/Motivation

#2361539: Config export key order is not predictable for sequences, add orderby property to config schema ā†’ introduced \Drupal\Core\Config\Schema\SequenceDataDefinition, a subclass of \Drupal\Core\TypedData\ListDataDefinition which was used until then.

This new class was associated with the sequence config schema type. Everything's been working fine.

But because the new SequenceDataDefinition did not override \Drupal\Core\TypedData\ListDataDefinition::getDataType(), the returned data type is still wrong.

This has not mattered in the >10 years that have passed since #1866610: Introduce Kwalify-inspired schema format for configuration ā†’ introduced the concept of config schemas nor in the almost 9 years since #2277945: Typed configuration implements TypedDataInterface improperly ā†’ added typed data integration:

sequence:
  label: Sequence
  class: '\Drupal\Core\Config\Schema\Sequence'
  definition_class: '\Drupal\Core\TypedData\ListDataDefinition'

ā€¦ but then again:

  1. \Drupal\Core\TypedData\ListDataDefinition is atypical because it overrides the inherited \Drupal\Core\TypedData\DataDefinition::getDataType() which would've returned the correct value
  2. It's only now that we're getting serious about config validation (see šŸŒ± [META] Untie config validation from form validation ā€” enables validatable Recipes, decoupled admin UIs ā€¦ Active ), which is why I discovered it in āœØ Expose validation constraints (and validatability %) in Config Inspector UI Fixed .

Steps to reproduce

N/A

Proposed resolution

Tests + fix.

Remaining tasks

None.

User interface changes

None.

API changes

None.

Data model changes

None.

Release notes snippet

N/A

šŸ› Bug report
Status

Fixed

Version

11.0 šŸ”„

Component
Typed dataĀ  ā†’

Last updated 13 days ago

  • Maintained by
  • šŸ‡¦šŸ‡¹Austria @fago
Created by

šŸ‡§šŸ‡ŖBelgium wim leers Ghent šŸ‡§šŸ‡ŖšŸ‡ŖšŸ‡ŗ

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

Comments & Activities

Production build 0.71.5 2024