While working on a select or other implementation for list fields. I got blocked by the fact that options_allowed_values
uses stale field settings to determine it's allowed values. This creates a problem because select or other adds a new option to the field settings upon form submission, which should then be picked up by AllowedValuesConstraintValidator. But AllowedValuesConstraintValidator uses options_allowed_values
, which uses the stale field settings to produce a list of options without the newly added option.
I will work on a test which demonstrates the problem, but in the mean time, the attached patch fixes it.
Change the behavior of list field items so that the field definition is always fetched from storage when getting the allowed values so that the instance object does not store stale data.
1. Contrib module the allowed values constraint plugin (each module does this making a module incompatible with each other).
2. Contrib module migrates list fields to text fields, provides duplicate code to handle allowed values, migrates back on uninstall.
3. Contrib module obliterates list field type plugins and replaces with its own code that does not use allowed values option (the nuclear option).
4. Contrib module does not use list fields and site builders that want to use the module must do so before deciding their entity architecture and cannot swap out to a widget without re-architecting and migrating data (seemingly not a good user experience).
5. Contrib module similar to conditional field can work with multiple fields (not as seamless as one field for things such as views integration, data export).
- Priority
- Performance Impact?
None.
None.
None.
Needs work
10.1 ✨
It denotes an issue that prevents porting of a contributed project to the stable version of Drupal due to missing APIs, regressions, and so on.
Used to track the progress of issues reviewed by the Drupal Needs Review Queue Initiative.
Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
No activities found.