Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Adding field groups to the form display of a Paragraph has no effect. The field groups are not added when editing a paragraph entity.
An issue has been raised in the Field Groups queue: #2637148: Field Group not working on node edit inside paragraph but it seems like in Paragraphs current form we would need a core patch to get field groups working.
Can something be done in the Paragraphs module to make this work?
Comment | File | Size | Author |
---|---|---|---|
#53 | interdiff-2675136-42-53.txt | 2.47 KB | JeroenT |
#53 | field_group_not_working-2675136-53.patch | 3.52 KB | JeroenT |
#53 | field_group_not_working-2675136-53-test-only.patch | 2.27 KB | JeroenT |
#44 | field_group_not_working-2675136-42.patch | 2.92 KB | miro_dietiker |
#40 | interdiff-2675136-37-40.txt | 1.52 KB | JeroenT |
Comments
Comment #2
reekris CreditAttribution: reekris commentedComment #3
reekris CreditAttribution: reekris commentedComment #4
reekris CreditAttribution: reekris commentedComment #5
reekris CreditAttribution: reekris commented#2675136: Field Group not working on node edit inside paragraph
This is the related core issue where it is discussed that instead of patching core it could maybe be solved in the Paragraphs module similarly to how IEF solved it.
Comment #6
BerdirThe core issue is #2640056: Contrib modules can't alter the building of entity form displays actually. And someone posted there that it works now for them.
Comment #7
reekris CreditAttribution: reekris commentedOh I had linked the wrong issue..
I set the core issue back to needs review since it seems it is not actually fixed. The same issue is also reported in the field group queue #2637148: Field Group not working on node edit inside paragraph. Question is if the issue should be fixed in core, field group or paragraphs.
Comment #8
kevinvhengst CreditAttribution: kevinvhengst commentedWe've created a patch that resolves the issue of using the field group module with paragraphs.
This patch is very specific for field groups, but it works for us.
Comment #9
miro_dietikerPlease provide a test dependency first for field group.
Then we need to have a test that is implements a field group test.
Comment #10
esod CreditAttribution: esod at Memorial Sloan Kettering Cancer Center commentedPatch
paragraphs-2675136-8.patch
works for us without a Core patch or a Field Group patch. Here's proof:We're having trouble upgrading paragraphs from 1.0-rc4 to 1.0-rc5. We use drush make and the database updates don't run when we build with rc5. For the time being, I'm going to reroll this patch for use with rc4.
Comment #11
esod CreditAttribution: esod at Memorial Sloan Kettering Cancer Center commentedfield-group-not-working-rc4-2675136-11.patch
is a reroll ofparagraphs-2675136-8.patch
for use with rc4.Comment #12
webflo CreditAttribution: webflo at UEBERBIT GmbH commentedComment #13
miro_dietikerThen simply postponed on that issue. Please help make it happen.
Comment #14
acbramley CreditAttribution: acbramley commentedRolled against 8.x-1.x, a bit more code has been added around this area in rc5 so not sure if this is correct.
Comment #15
eloivaque#14 Work for me
Comment #16
RKopacz CreditAttribution: RKopacz commentedJust tried applying #14 to a 8.x-1.x-dev, but still not getting the accordion I inserted in one paragraph type (which accordion was already added to the paragraph type, and the paragraph type was already created, before I updated the module to the dev version). When I tried, I get the message:
Unreversed patch detected! Ignore -R? [n] n
So I ignored the patch and flushed caches etc, thinking that the patch had already been committed in dv, and still no accordion in the paragraph inside the node edit form.
Comment #17
esod CreditAttribution: esod at Memorial Sloan Kettering Cancer Center commentedRerolling the patch for 8.x-1.x.
There is, of course, a better solution for this issue than this patch. But this patch does keep things going for the time being.
Comment #20
miro_dietikerPromoting. For nice UX, grouping concepts are important and we want to allow these without the need of code.
If you want to get this (workaround) in, please help with test coverage.
Also, put a reference to the core issue with a @todo into the workaround code.
Comment #21
himerus CreditAttribution: himerus as a volunteer commentedI can confirm that #17 seems to work as desired. Horizontal and Vertical tabs work in a Paragraph.
Comment #22
esod CreditAttribution: esod at Memorial Sloan Kettering Cancer Center commentedAdded the @todo to the workaround code. Fixed the tests.
Comment #25
miro_dietikerIf head tests fail again, we need a separate patch. Please don't mix this. But i thought we fixed that already. Did core revert?
Comment #26
esod CreditAttribution: esod at Memorial Sloan Kettering Cancer Center commentedYes, of course, separate patches. I don't think the test failures are related to the workaround patch. But anyway here is the test patch. I'll assertRaw on the name to try to get the patch to pass on the dispatcher. The tests have no failures on my local system.
I'd love to redesign these tests because they're so long. At the least make them one public function per test class. But that should be another issue.
What seems to have changed is
'fields[status][region]' => 'content',
has become'fields[status][parent]' => 'content',
. I don't know if that's a core reversion.I don't need to test these patches against both PHP5.5 and PHP7 since the PHP version is not relevant to this issue. I know I added the PHP7 test. How do I get the patches to test against only PHP5.5? Thanks.
Comment #27
esod CreditAttribution: esod at Memorial Sloan Kettering Cancer Center commentedHere is the patch for the workaround code with the @todo added. It won't pass testing, so I'm not going to test it. Maybe we should at this point put the test patches into a separate ticket.
Comment #31
miro_dietikerA feature can only be committed if it has test coverage. We don't do features and test coverage for those in separate tickets.
In order to allow you to implement tests, i committed a test dependency to field_group, so tests can start enable it.
Comment #32
drobnjak CreditAttribution: drobnjak at MD Systems GmbH commentedComment #33
esod CreditAttribution: esod at Memorial Sloan Kettering Cancer Center commentedAh, test dependency to field_group so tests can start to enable it. Got it. Thanks.
Comment #34
drobnjak CreditAttribution: drobnjak at MD Systems GmbH commentedCreated new test, following the group definition and adding fields as children from the FieldGroupUiTest.php and EntityDisplayTest.php tests from the field_group module. In both classes it is defined completely different, since one of them is not using or creating children. Both of them are using FieldGroupTestTrait which I am also using in this test.
Currently trying to resolve errors in adding children to group. Uploading a patch to show progress and for a discussion.
Comment #37
drobnjak CreditAttribution: drobnjak at MD Systems GmbH commentedTest completely reworked, uploading without interdiff. New test (ParagraphsModuleFieldGroupTest) is working completely.
Comment #40
JeroenTCreated a new patch. Let's see if this fixes all the test failures.
Comment #41
gcharles CreditAttribution: gcharles commentedThe Latest Patch(#40) Works for me +1
Comment #42
esod CreditAttribution: esod at Memorial Sloan Kettering Cancer Center commentedWe can use methods from
ParagraphsTestBase
to help the test code.Comment #43
miro_dietikerThe interdiff is wrong. The patches seem to be stuck...
Comment #44
miro_dietikerReuploading.
Comment #45
esod CreditAttribution: esod at Memorial Sloan Kettering Cancer Center commentedI changed the test's name to match the pattern of the other tests names, but neglected to add it to my branch so the interdiff was incomplete.
I see you've uploaded the patch again. Great. :)
Comment #46
miro_dietikerRunning this test-only doesn't fail. So the tests don't test something valuable until now.
Comment #47
JeroenTLooking at the test.
Comment #48
JeroenTChanged the test. The problem with patch in #44 is that it was testing a paragraph field in a field_group, instead of testing a field_group in a paragraph entity.
Patch field_group_not_working-2675136-48-test-only.patch should fail.
Patch field_group_not_working-2675136-48.patch contains the test and the fix, so this patch should be green.
Comment #53
JeroenTComment #57
miro_dietikerWonderful! Thx for fixing it and that's why we like to see test-only patches. :-)
Committed with clarifying comments. Party, we have field group support now.
Comment #58
drobnjak CreditAttribution: drobnjak at MD Systems GmbH commentedComment #60
nimoatwoodwayUnfortunately the problem with field groups is back. See #40 and #41 Field Group Issue
Upgraded field_group from 3.0.0-beta1 => 3.0.0-rc1 and now the grouping is broken within node edit.
Interesting: It does work within a geysir modal window.
Already tried to change widget from Classic to Experimental but does not work either.
Has anyone an idea how this could be fixed? Many thanks for any info.
EDIT: Problem occurs with paragraphs versions 8.x-1.6 and 8.x-1.8 drupal 8.7.3 and 8.7.2
Comment #61
nimoatwoodwayGetting fixed here: https://www.drupal.org/project/paragraphs/issues/2907094#comment-13174221