- Issue created by @hudri
- Status changed to Needs work
over 1 year ago 3:57pm 4 July 2023 - 🇦🇹Austria hudri Austria
I just pushed a draft implemention on the feature fork repo. It works all quite well except one thing:
Duplicate component does not emit any event and therefore bypasses the numeric limit :-(
- @hudri opened merge request.
- 🇭🇺Hungary nagy.balint
Hi!
This part of the code
if (empty($disallowed_types[$parent_layout][$region]['paragraph_types'])) { return; }
Was done cause of https://www.youtube.com/shorts/Zmx0Ou5TNJs
Apart from that, maybe we just need to explain this limitation with duplicate on the UI somewhere, and we can still have this feature?
- 🇦🇹Austria hudri Austria
I totally agree with avoiding nesting
if
s, but we no longer can use that guard clause with the early exit because we also need to check for the numeric limit.You are the maintainer, so it is your decision when you want to merge. But I personally would not advise to merge it yet. Even if we add a message at the form, this is only visible to site architects. An editor using the builder would not know that limitation.
(This also is the reason why I created the draft MR, if somebody really needs that feature, it can be added with composer-patches and https://git.drupalcode.org/project/layout_paragraphs_limit/-/merge_requests/10.patch)