When creating nodes inside a group (from /group/[gid]/node/create), group mapping field should be hidden. It doesn't play well in this context and if it's left blank relationship to current group is not created.
Attached patch verify current route inside form alter, if it's equal to 'entity.group_content.create_form' return immediately without altering form.

CommentFileSizeAuthor
#2 3137202-2.patch667 bytesmaurizio.ganovelli

Comments

maurizio.ganovelli created an issue. See original summary.

maurizio.ganovelli’s picture

StatusFileSize
new667 bytes
neerajsingh’s picture

Thank you, @maurizio.ganovelli for the patch.
patch at #2 worked as expected for the scenairo explained at issue summary.

But, if we wish to add a node from the group1 page (from /group/[gid]/node/create), and the same node to be part of another group too.
The existing feature of having the "group mapping field" enabled is helpful.

jcandan’s picture

Then, could we instead pre-fill the field with the desired Group?

So, instead of hiding the group filed, we ensure at least the group the node is being added to is in the field by default. Thoughts?