Treating ListStringItem values as machine_name breaks previous usage

Created on 3 January 2024, 11 months ago

Problem/Motivation

Core 10.2 now handles the 'value' portion of ListStringItem allowed value pairs as #type = "machine_name". This forces values to be composed of lowercase letters, numbers or underscores only. That breaks any usage that included values that don't meet those parameters.

So, for example, I think it might be common to use allowed values to manage CSS classes in allowed values lists, e.g.

my-class-name => My Style Label
title--hidden => Visually Hidden Title
camelCaseClassName => Camel Style

Those values are no longer valid.

It's worth noting that the change breaks the use-case listed as an example in ListStringItem's own annotation description:

description = {
  @Translation("Values stored are text values"),
  @Translation("For example, 'US States': IL => Illinois, IA => Iowa, IN => Indiana"),
}

IL, IA and IN are all invalid now, as they contain capital letters.

Was there some previous indication that values should conform to machine name limitations? I couldn't find any change record, issue or even a mention of the change on the release notes that provides any background for the change.

Steps to reproduce

Create a new List (text) field, and try to provide any of the sample value => label pairs listed above.

Proposed resolution

Revert the change?

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

πŸ› Bug report
Status

Closed: duplicate

Version

10.2 ✨

Component
OptionsΒ  β†’

Last updated 9 days ago

No maintainer
Created by

πŸ‡ΊπŸ‡ΈUnited States justcaldwell Austin, Texas

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

Comments & Activities

Production build 0.71.5 2024