- 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?
- ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
Looking great! Reviewing, and adjusting slightly now that ๐ Version component prop definitions for SDC and Code components Active is in: that requires some changes to the newly added tests.
- ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
Adjusted for ๐ Version component prop definitions for SDC and Code components Active ๐
Follow-up: ๐ Create unit test coverage for `ValidSlotNameConstraintValidator` Active .
- ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
Performed manual testing.
- When creating a code component with
-foo
as the entered slot name:foo
becomes the machine slot name automatically, the title remains-foo
- When creating a code component with
"n๐t_valid
as the entered slot name:
- When creating a code component with
- ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
Actually, found a bug in exposed slot name validationโฆ fixing.
-
wim leers โ
committed c5f17c17 on 0.x authored by
phenaproxima โ
Issue #3519891 by phenaproxima, wim leers, f.mazeikis, isholgueras,...
-
wim leers โ
committed c5f17c17 on 0.x authored by
phenaproxima โ
- Status changed to Fixed
25 days ago 12:39pm 18 June 2025 Automatically closed - issue fixed for 2 weeks with no activity.