- Issue created by @wim leers
- π¬π§United Kingdom justafish London, UK
wim leers β credited justafish β .
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
OMG, AFAICT
\Drupal\Core\DefaultContent\Importer
exists but not\Drupal\Core\DefaultContent\Exporter
?! CR: https://www.drupal.org/node/3445169 β .I'm hoping that @phenaproxima can push this forward π
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
Ironically I surfaced something closely related in reviewing that Recipes MR a ~year ago: #3439923-31: Add recipes api as experimental API to core β + @phenaproxima's response at -32, where he says:
it's exported by the default_content module, which is what generates these YAML files. IMHO they should not be changed at this time, but if (which, once this is committed, is really when) core adds the ability to export content entities as YAML [β¦]
ππ¬ β no related issues linked from #3439923 that are doing that, and search engines aren't finding such an issue eitherβ¦
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
@phenaproxima: I suspect that the
NULL
values stored in the DB forparent_uuid
andslot
are actually cast to string at some point (either the DB layer, or SQL content entity storage, or Entity Field API, or β¦), and that's how they end up being exported wrong?Note that I actually can get validation errors to occur, for example doing
diff --git a/tests/fixtures/xb-page-with-data.yml b/tests/fixtures/xb-page-with-data.yml index 97b35785c..216b7041e 100644 --- a/tests/fixtures/xb-page-with-data.yml +++ b/tests/fixtures/xb-page-with-data.yml @@ -19,7 +19,7 @@ default: inputs: width: sourceType: 'static:field_item:list_integer' - value: 50 + value: 40 expression: βΉοΈlist_integerβvalue sourceTypeSettings: storage:
results in:
1) Drupal\Tests\experience_builder\Functional\DefaultContentImportTest::testImportDefaultContentWithXbData Drupal\Core\DefaultContent\InvalidEntityException: /Users/wim.leers/core/modules/contrib/experience_builder/tests/src/Functional/../../fixtures/xb-page-with-data.yml: components.0.inputs.16176e0b-8197-40e3-ad49-48f1b6e9a7f9.width=Does not have a value in the enumeration [25,33,50,66,75]. The provided value is: "40".
So that means
Worse: the Recipes default content import functionality apparently did not report a validation error?! π±
is a different problem, and it's a beta-blocking one.
Extracted that to π Tighten validation of `parent_uuid` and `slot` on XB fields to match the strictness of config Active .
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
- π¦πΊAustralia larowlan π¦πΊπ.au GMT+10
β¨ Content templates, part 3b: store exposed slot subtrees on individual entities Active adds an
array_filter
toComponentTreeItem::getValue
that would also have resolved this - π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
Cool, then maybe this issue will be just about test coverage :)