- Issue created by @phenaproxima
- 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
This is inaccurate.
ComponentTreeItem
doesn't allowDynamicPropSource
s. That's been the case since 📌 Tighten validation: only allow StaticPropSource in XB fields + PageTemplate, DynamicPropSource in ContentTypeTemplate Active .Only
ContentTemplate
config entities' (being introduced in #3517741, which spawned this issue to keep scope tight there) component trees will be allowed to useDynamicPropSource
s. - First commit to issue fork.
- Merge request !908[#3518336]: Initial POC on moving field dependencies to the ContentTemplate entity → (Open) created by danielveza
- 🇳🇿New Zealand danielveza Brisbane, AU
Im pretty interested in following the ContentTemplate work, so I figured I'd make a start on this one based on the IS and the discussion from #2. I've pushed up a POC of the existing work I've done so far, which now adds config dependencies for fields to the content template entities. This has test coverage, but still additional work to be done around code cleanup and removing the legacy code from `ComponentTreeItemTest`
- 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
Per #3518248-11: [PP-1] Content templates, part 4 (boss battle): create a UI for editing templates → , this should block that.
- 🇺🇸United States phenaproxima Massachusetts
I did some work on this to move the dependency resolution into
ComponentInputs
. I also made sure that it checks for base field overrides, which are another kind of config dependency (and we do need to test for this). - 🇺🇸United States phenaproxima Massachusetts
I have a question that either Wim or Lauri need to answer, brought up by this issue.
The way the MR currently works, a content template that contains a dynamic prop expression targeting a field -- base field override or normal bundle field -- will cause the template to be dependent on that field.
That makes sense from a data integrity standpoint, but are we not setting up a situation where, if a site builder deletes a field, all templates that mention that field are deleted too? That seems extremely bad.
What should we do here? We probably need
ContentTemplate
to implementonDependencyRemoval()
to handle this case in some way, or XB to be able to show a graceful fallback (assuming it doesn't already) if a prop expression is referring to a field that no longer exists. Either way, this needs product and tech lead input, so assigning this to Wim before we do any more work on it. - 🇫🇮Finland lauriii Finland
We certainly should not delete the whole content template as a result of deleting a field. 😅 I think we should just remove the use of the dynamic prop from the content template. In case the deleted field happens to be a required, we replace the dynamic prop expression with example value.
- 🇺🇸United States phenaproxima Massachusetts
Cool. This sounds like it's more of a frontend issue, then, and not really a data integrity problem (and thus, I'd imagine, not a stable blocker).