- Issue created by @phenaproxima
- π¦πΊAustralia larowlan π¦πΊπ.au GMT+10
+1 for this, it will likely require a dependency on the serialization module but I think that is fine
- πΊπΈUnited States phenaproxima Massachusetts
Just to give a little context, @larowlan linked me to https://www.previousnext.com.au/blog/we-could-add-default-content-drupal..., which is from almost a decade ago. It outlines four tricky problems that prevent the addition of default content capabilities to core. I want to quickly shoot these down.
Adding default content to standard profile would mean that none of the profile's configuration would have been imported yet.
Core's default content import is done by recipes, and works well. The concern about shipping content with modules is moot. Recipes' job is to put all necessary configuration in place before any content is created, and the recipe system's strong, straightfoward configuration handling means that default content can come in easily. This concern is definitely no longer applicable.
The second issue here is that the default content module relies on the Rest, HAL and serialization modules in core.
This was true for v1 of the Default Content module. We would still need to have Serialization enabled for export, that's true...but there are no special modules required for import, which is the end user-facing case.
There are shortcomings in core's normalizers. The main ones are around fields that resemble entity references but really aren't and fields with calculated values. And then there's normalizing files and images.
This is probably legitimate, although the picture probably significantly better now than it was at the time the blog post was written, thanks to the advent of JSON:API and the core improvements that it brought us. But yes, normalization is the meat and potatoes of doing default content export correctly.
Just because we could add default content to the standard profile - does that mean we should?
We already put default content in recipes, which puts profile support on the back burner (where it belongs). This is not a problem anymore.
So there you go. If you ask me, the time to do this is now!
- πΊπΈUnited States thejimbirch Cape Cod, Massachusetts
Moving to the Default content system.
- πΊπΈUnited States nicxvan
Slightly different use case, but tome can export content to json for keeping it in git.