Problem/Motivation
Working on Display Builder, #3562989: Implements RevisionLogInterface for Instance entity, we noticed some quirks in the soruce field model:
FieldItemInterface::propertyDefinitions()is missing, we need to definesource_id,source,third_party_settingsandnode_idSourceValueItemis extendingDrupal\Core\Field\Plugin\Field\FieldType\MapItemwhich doesn't seem to be the good parent, because it imply there is a singlevalueproperty bagging thesource_id,source,third_party_settingsandnode_idpropertiessource_idmust be required
Proposed resolution
Fix those.
The ui_patterns_field module is still experimental, so we it seems we can break the storage here. However, we are committed to storage stability in Display Builder which is heavily using this field. So, lets not break anything and this is the time to also move ui_patterns_field out of the experimental status.
Add some tests?
Issue fork ui_patterns-3584856
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
pdureau commentedI will give a try.
Would it also be the opportunity to add an index in order to improve performance? Unfortunately, the best candidate,
node_idis not mandatory at UI Patterns level.Comment #3
pdureau commentedComment #4
pdureau commentedLet's talk :)
Comment #6
pdureau commentedComment #7
pdureau commentedIs
anythe most suited data type for storing an associative array?Can we set a better type without breaking anything?
Comment #8
pdureau commentedLet's talk about tests and module status change before merging anything.
Comment #9
pdureau commented1 remaining tasks: Check if moving from
anytomapis doable by also changing the config schema (now, we have 2 issues: 1. phpunit fails, 2. we may break storage stability)No need for more tests.
About the status change of the module,, UI Patterns Field will not be experimental anymore. But it will be done in #3548884: [trans] Make SourceValueItem field type translatable with synchronized and asynchron translations
Comment #10
pdureau commentedIt doesn't break the storage: I have built content using
SourceValueItemfrom the 2.0.x and switch to the MR branch, everything still work the same.phpunit fails were a bit more weird. It was triggered when moving from
anytomapbut were related to$definitions['source_id'] = DataDefinition::create('string')->setRequired(TRUE);:I removed the
setRequired(TRUE). Maybe you will have a better idea.