Closed (fixed)
Project:
Paragraphs Sets
Version:
8.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
27 May 2019 at 14:04 UTC
Updated:
3 Dec 2020 at 17:49 UTC
Jump to comment: Most recent, Most recent file

Comments
Comment #2
vtcore commentedComment #3
hawkeye.twolfThank you for making this patch, @vtcore! I am about to try it out. The module README says:
But that isn't the case. Maybe it was removed since the README was last updated?
Comment #4
hawkeye.twolfWorks great! A few notes:
Patch forthcoming to address at least issue #4, if not all. Thanks again!
Comment #5
stborchertThanks for the work and sorry for the confusion. I thought, that I had implemented this feature before but couldn't find it anymore. As you said, it has been removed while rewriting the whole module to not use a custom widget.
It would be great if your patch could cover the necessary changes in the README, too.
Comment #6
hawkeye.twolfYou got it, @stBorchert. Patch attached to address the items in my previous comment plus the README updates. Note that I just changed the wording of the "Default set" form element description to indicate that the "Default paragraph type" needs to be set to "- None -"... I think it's more clear that way, so people don't get confused looking at the widget settings and wonder why their "Default paragraph type" isn't getting used. I also refactored the Summary settings alteration to output the human-friendly name rather than the machine name for both the "Limit sets to" and "Default set" settings. Patch and interdiff attached.
Comment #7
hawkeye.twolfHold up, didn't properly test that. Although the "Default set" setting is now exposed without the "Enable Paragraphs Sets" box checked, the "Default set" setting still doesn't take effect without it. Will post a new patch to fix that shortly.
Comment #8
hawkeye.twolfNew patch! Note that I pulled out the
getDefaultParagraphTypeMachineName()method, as it was only used in one place and, from reviewing the logic, didn't seem to do what it purported (default_paragraph_typerefers to a Paragraph type not a Paragraph Sets type).Comment #9
pcate commentedI just applied this patch and it added the desired functionality.
Comment #10
inedyalkova commentedComment #11
stborchert@inedyalkocva: please don't mix things up. Your patch belongs to #3156961: Cannot install on Drupal 9.0.1 via Composer.
Comment #12
sfuchsbe commentedI can confirm that the patch #8 is providing the expected funtionality. But I'm wondering if this integrates perfectly in the idea of paragraphs especially when having restrictions configured in the entity reference revisions field settings.Let's just imagine the following scenario:The ERR field is configured to just allow to have a single paragraph type A referencedThe field cardinality is set to 1There is a Paragraphs Set configured with paragraph type AIn the widget configuration I'm adding this set to the fieldNow I'm able to use the paragraph type twice which is contradictionary to the configured field cardinalityYou can just slightly change the scenario to other use cases that will then allow for using paragraphs that are not initially permitted in the ERR field.Probably you should think of a separate content entity for paragraph sets that can directly be used as ERR field similar to paragraph types. Then the configuration options would appear more reasonable.This is just a high level thought using an edge case which might not even be relevant but worth considerin. If this is not the intention of this patch in my opinion you can go ahead with merging to the module. I'm going to use this patch anyway because it is filling a gap occuring in one of my projects.
Thank you for your work.
edit: Keeping this comment for consistency.
Comment #13
sfuchsbe commentedJust realized that it is wrong what I stated in my previous comment. But still something strage is happening on my site. Maybe I will find out what I did wrong. If my result is worth to be shared I will provide an update...
...otherwise - good job. Go ahead ;)
Comment #14
sfuchsbe commentedI was now able to reproduce what I did wrong and why:
For the issues mentioned above I'm adding a rework of the patch in #8 with the following changes:
Unrelated to this issue one could investigate (should be handled in separate issues):
Happy to receive your feedback :)
Comment #16
stborchertThank you all for your work (and patience).
I've committed the patch from comment #14 (with one minor necessary change for widgets allowing unlimited items).
Comment #17
sfuchsbe commentedHi @stBorchert,
I just checked your changes that were actually committed to the repository.
paragraphs_sets.module@179ff:
Actually with this change you introduced something that was not intented at least by me. The idea was that you could use default set even if "use_paragraphs_sets" is unchecked. Therefore the checkbox in settings is not controlling the visibility of the defaults dropdown. With your change one has to check the setting which will automatically add the additionall form elements for managing paragraph_sets. The exit point suggested in #14@332ff:
I will create a new issue to revert this change - then it is up to you to include this as an additional feature or decline. I'm going to use it ;)