- Issue created by @ktegory
- ๐ช๐ธSpain ktegory Madrid
Detected the issue in Color list and Style list fields.
- ๐บ๐ธUnited States justcaldwell Austin, Texas
Thanks for reporting @ktegory. I know there were some changes to fields in 10.2. I should be able to take a look this week.
- ๐บ๐ธUnited States justcaldwell Austin, Texas
As of Drupal 10.2, the core Options module (the one that provides test list allowed values functionality) requires the 'value' portion of each pair to be a unique "machine readable" format -- i.e. lowercase letters, number and underscores only. I couldn't find a change record or issue that explains the thinking, other than a general movement toward ensuring all config can be validated in some way? ( ๐ฑ [meta] Add constraints to all config entity types Active ) ๐คท๐ปโโ๏ธ
So, yes, Style Selector is currently, fundamentally incompatible with 10.2. ๐ I'm not sure of the path forward at the moment, but I'll cut a release that clarifies the lack of compatibility.
- ๐บ๐ธUnited States justcaldwell Austin, Texas
I opened an issue against core's options module ๐ Treating ListStringItem values as machine_name breaks previous usage Active .
I have some potential fixes in mind if there's no progress there.
- ๐ช๐ธSpain ktegory Madrid
Hi @justcaldwell,
Thanks for your answer.
I just found this article, maybe it can be of help...
https://kevinquillen.com/fixing-list-text-field-data-integrity-issues-dr... - Status changed to Closed: works as designed
over 1 year ago 9:13pm 3 January 2024 - ๐บ๐ธUnited States justcaldwell Austin, Texas
Thanks @ktegory!
๐ Regression from #2521800: using machine name element for ListStringItem breaks with existing data Fixed is already fixed and committed, so it looks like the change will be reverted in the next release.
Per the update entry on that same blog, you could wait for 10.2.1, or apply the patch from the issue above.
Thanks again.
- ๐บ๐ธUnited States justcaldwell Austin, Texas
I confirmed that the patch does indeed fix the primary issue. It still uses the "machine name" element (to retain its ability to generate default values based on labels), but removes the elements restrictive validation.
I'll just note that I don't see much utility in those default values for Style Selector's use-case. I suspect the default would get changed 99.9% of the time, resulting in an extra click/step to switch to edit mode. Because of this, I'll likely switch back to using a textfield over machine_name in a subsequent release.
- ๐บ๐ธUnited States justcaldwell Austin, Texas
Updating the issue summary.
- Status changed to Fixed
over 1 year ago 10:07pm 3 January 2024 - ๐บ๐ธUnited States justcaldwell Austin, Texas
Updating to fixed to give credit.
Automatically closed - issue fixed for 2 weeks with no activity.