Problem/Motivation
We have a plan to adopt two properties from Display Builder project in our source config schema:
We also need them as field properties in our Source field type, alongside the 2 existing properties:
'source_id' => [
'type' => 'varchar_ascii',
],
'source' => [
'type' => 'blob',
Because:
- Symmetric translations is also expected in content storage
third_party_settings will fix a display builder bug. See below:
When we save a display as a field, we put each source from the root as a field item:
foreach ($data as $offset => $item) {
$this->list[$offset] = $this->createItem($offset, $item);
}
$this->getEntity()->save();
However, we have this in the root:
0 => array:4 [▼
"node_id" => "68e6c7e9e3ba0"
"source_id" => "component"
"source" => array:1 [▶]
"_third_party_settings" => array:1 [▶]
]
2 => array:4 [▼
"node_id" => "68e6d0d3b81d4"
"source_id" => "component"
"source" => array:1 [▶]
"_third_party_settings" => array:1 [▶]
]
So, node_id and _third_party_settings are not saved.
Proposed resolution
Add those 2 properties to the field storage. Which typed data type?
Comments
Comment #2
pdureau commentedComment #3
pdureau commentedComment #6
christian.wiedemann commentedComment #7
christian.wiedemann commentedI added the two new columns and also ensure that our form elements pass repass this back to the field.
Comment #8
pdureau commentedHello,
I am testing with an existing content display override in Display Builder.
The updb has run successfully:
However, when I click on "Publish" button in the content display override in Display Builder, I get this:
Comment #9
pdureau commentedComment #10
pdureau commentedOK for me. Thanks a lot.
Comment #12
grimreaperHi,
One minor changes to do in the hook_update number.
Thanks for your work here!
Comment #14
just_like_good_vibesComment #17
herved commentedThis is producing a lot of config schema errors on my side:
Also node_id looks specific to nodes, what I have here are custom entities (public_health_event).
Edit: Ah ok this was already reported in #3574820: Unexpected properties in ComponentSource data