- Issue created by @thomas.frobieter
- 🇩🇪Germany Anybody Porta Westfalica
Yes I can confirm this. The most strange thing is, that 2 of 3 disabled top-level field groups are rendered (incorrectly) and one is not, eventhough I can't see a difference between them.
- 🇩🇪Germany Anybody Porta Westfalica
Just found this issue from the past that seems similar. I'll close it as duplicate: #3258372: Groups disabled in a specific display are not hidden →
But it looks like this issue with view displays already existed in the past! - 🇩🇪Germany Anybody Porta Westfalica
Ok I propably found something:
/** * Implements hook_entity_view_alter(). */ function field_group_entity_view_alter(&$build, EntityInterface $entity, EntityDisplayInterface $display) { $context = [ 'entity_type' => $display->getTargetEntityTypeId(), 'bundle' => $entity->bundle(), 'entity' => $entity, 'display_context' => 'view', 'mode' => $display->getMode(), ]; field_group_attach_groups($build, $context);
field_group_attach_groups($build, $context);
doesn't get the $display parameter passed!
I think that might be logically incorrect, as it should act based on the rendered
$display
!
Still searching... - Merge request !118Issue #3537082 by thomas.frobieter, anybody: Disabled field group containers... → (Open) created by Anybody
- 🇩🇪Germany Anybody Porta Westfalica
Okay maybe I found a fix, seems that "hidden" field groups were just added regularly, where they should not. Please check if this works as expected and let's see what the tests say!
I'd very much like to have this reviewed by other field_group maintainers or a few community members, before merging to ensure there are no unexpected side-effects!
The output is correct now: the empty fieldsets have gone, and the tabs still work fine in default/full view mode.
- 🇩🇪Germany Anybody Porta Westfalica
Thanks for the feedback @thomas.frobieter. Would be great to get some more feedback from other users and maintainers. The failing test is unrelated, I'll create a separate issue for that.
Okay, now empty groups are also hidden in the display configuration, so this fix needs to be modified.
- First commit to issue fork.
- 🇩🇪Germany Grevil
Failing tests are unrelated and should be fixed in 📌 Fix failing tests / CI pipeline and clean-up code Active .
- 🇩🇪Germany Anybody Porta Westfalica
Great thank you @Grevil! @thomas.frobieter could you please test, if the issue is gone and the side-effects we experienced with my try are also gone?
- 🇩🇪Germany Anybody Porta Westfalica
@grevil would it be hard to add a test for this?