AllowedValuesConstraintValidator::getValidChoices only checks for config fields and not base fields

Created on 10 August 2021, almost 3 years ago
Updated 31 October 2023, 8 months ago

On getValidChoices, it tries to load all the storage definitions from config fields but base fields can also define allowed values and then the definition will be null, getFieldStorageDefinitions needs to be used instead (from the entity field manager) that returns both base fields and config fields.

Patch attached for 4.x, I think the same file content is present on 1.x so could be applied in both branches.

I suspect that this will fix #2985361: "The value you selected is not a valid choice" error is thrown when a workflow field is present β†’ too

πŸ› Bug report
Status

Needs review

Version

4.0

Component

Code

Created by

πŸ‡ͺπŸ‡ΈSpain pcambra Spain, πŸ‡ͺπŸ‡Ί

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024