- Issue created by @wim leers
- šŗšøUnited States phenaproxima Massachusetts
wim leers ā credited phenaproxima ā .
- š§šŖBelgium wim leers Ghent š§šŖšŖšŗ
Thanks, @phenaproxima at https://git.drupalcode.org/project/experience_builder/-/merge_requests/8..., for making me realize this!
- šŖšøSpain penyaskito Seville š, Spain šŖšø, UTC+2 šŖšŗ
Isn't this a duplicate of š Disable additionalProperties in slots, props in SDC json schema Active from core?
- šŖšøSpain isholgueras
Confirmed you can create slot with emojis in the name,
and this breaks the site.
Note: breaks the site but you can remove the component and everything works
- šŖšøSpain isholgueras
Isn't this a duplicate of š Disable additionalProperties in slots, props in SDC json schema Active : Disable additionalProperties in slots, props in SDC json schema from core?
I think it is. The validation is done in the
ComponentValidator.php
in core. Slot names don't seem to be validate. - š§šŖBelgium wim leers Ghent š§šŖšŖšŗ
Because this is (well, must be) a XB-wide restriction, this
does not belong in\Drupal\experience_builder\ComponentSource\ComponentSourceInterface::checkRequirements()
, but at the config entity level.The issue summary is already accurate.
- šŗšøUnited States phenaproxima Massachusetts
I guess I'll see how far I can take this.
- šŗšøUnited States phenaproxima Massachusetts
Before I write test coverage, would love some quick confirmation that this approach is sound, or if there's a better or different place this should go.
- šŗšøUnited States phenaproxima Massachusetts
I added some light test coverage here, but I have a question about where this validation belongs. The MR feedback seems to conflict with #9, and I'm not sure whether to believe now-Wim or past-Wim. :)
- šŗšøUnited States phenaproxima Massachusetts
Been thinking about this more, and the sense I'm getting is that what we want here is validation on multiple fronts. In other words:
- It shouldn't be possible to save a Component entity if its source plugin defines any invalid slots. This is what I've implemented so far in the MR.
- Nor should it be possible for components laid out in a tree to be sitting in an invalid slot (regardless of where and how that tree is stored).
- š§šŖBelgium wim leers Ghent š§šŖšŖšŗ
- š«š®Finland lauriii Finland
Let's make sure to test that the UI handles this gracefully to not introduce more error handling debt.
- š§šŖBelgium wim leers Ghent š§šŖšŖšŗ
This looks great!
I wanted to RTBC & merge, but:
- it's not yet passing CI
- I think the validation probably should be tightened slightly, do you agree?