- 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)
- First commit to issue fork.
- πΊπΈUnited States edwardsay
I have partially addressed the "duplicate" control issue and also, created a patch that can be applied to 1.0.1
- πΊπΈUnited States edwardsay
Created new MR https://git.drupalcode.org/project/layout_paragraphs_limit/-/merge_reque... that is mergeable into 1.0.x
(Patch https://git.drupalcode.org/project/layout_paragraphs_limit/-/merge_reque... can only be used if you use the dev version of the module. If you use the stable 1.0.1 version the patch is in the #13 comment)