Joining a group should be a wonderful, life changing experience. But it isn't.
- After choosing to join a group via the group operations block, a user is first redirected to a confirmation page.
- After they have confirmed their wish to join the group, (for no good reason) they are then dumped on the user account page at /user/[nid]
- They then have to navigate back to group
After confirming their membership they should be returned to the group.
I am assuming this to be a bug rather than a feature, because leaving a group is quite a pleasant experience and works as expected.
The same thing happens if an administrator creates a new group, and get sent to the user account page, not the new group page.
Comments
Comment #2
lobsterr commentedI have updated the logic of redirection. Now, first we check if user can view the group, then group content, then entity and front page
For me it looks also more logical to redirect user first to the group
Comment #3
mrpauldriver commentedThis works well @LOBsTerr. Thank you for putting in the time.
It would be good to display a status message confirming membership of the group and also something after leaving
"You have successfully joined this group"
"You have successfully left this group"
Comment #4
mrpauldriver commentedUpon being redirected to the leave group page, the user is presented with a leave group button, above which is the message "This action cannot be undone."
To me this message is confusing or (subject to permissions) perhaps not true.
I suggest that this message need not be displayed and could be removed.
Comment #5
lobsterr commented@MrPaulDriver - Added messages for both cases, when we join and leave the group. You are right, it was missing and confusing for users
Comment #6
mrpauldriver commentedStatus messages work well.
Still not sure about the help text when leaving a group. Do we need "This action cannot be undone"?. To me it sounds too permanent and depending on the groups's permission may not be accurate either.
The options could be;
- Keep as is
- Remove the text completely
- A more helpful message like. "This action will end your membership of the group?"
Comment #7
lobsterr commented@MrPaulDriver It is standard confirmation form message. I will check what can be done about it.
Comment #8
mrpauldriver commentedI thought it might be.
In case you had not noticed, I just edited the wording in my post to "This action will end your membership of the group", as my previous suggestion "Are you sure?" already appears in the title.
Comment #9
lobsterr commentedComment #10
mrpauldriver commentedGreat work.
One tiny detail - my mistake.
This action will end your membership of the group?
is actually is a statement rather than a question, so should not have a question mark
Comment #11
lobsterr commentedComment #12
mrpauldriver commentedThis is working for me. Thanks to @LOBsTerr
It would be good to see this committed to an RC3 release.
Comment #13
kristiaanvandeneyndeTypo?
While this might work well for members, it really sucks to create a node in a group and then not see that node. We need something better. Perhaps offload that logic to the plugin?
On a related note, the confirmation messages warrant their own issue. They don't need to be blocked by us finding a solution to the redirects.
Comment #14
lobsterr commented@kristiaanvandeneynde there is an attempt to handle redirection, when we add a node #2817109: How to redirect to the owning group after adding a gnode?. I think it could be useful to have similar settings for the redirection of the user after joining / leaving a group.
The only thing I don't like here we store these settings globally for all group types and not per group type. I was thinking maybe we should have a custom field settings for different custom settings. This field maybe used by other developers by altering the group type form.
I found this approach in message module. It works very well! Anyway, it would be great to have a chance to extend group settings.
Comment #15
mrpauldriver commentedComment #16
mrpauldriver commentedComment #17
dercheffePatch #11 works well for me thx. I agree with #14. It would be a great UX improvement for site builders (and as result also for the end users too) if there are following group settings available per group type
Just some ideas :)
Comment #18
pp.panatom commentedreplaced drupal_set_message() for drupal 9 compatibility
Comment #19
dxvargas commentedAbout the patch in #19:
The description "This action will end your membership of the group" in the GroupContentDeleteForm is not good, since it will applied by default to any group content, not only to group membership content.
For the rest, it seems good.
Comment #20
ressaI tried the Group module the other day, and was also puzzled: After creating a new group as administrator, I was sent to my user account page, and not the new group. The patch works well, and I am sent to the group after creating it, perfect.
Should separate issues be created for the
3.0.x-devand2.0.x-devbranches, once the details are settled here?Comment #21
lobsterr commentedI had an idea to move to a separate module and make it configurable per a group. I am afraid it will never be merged in the group module or we will have to wait for ages, what we are actually doing it.
I will check, what could be done, when I finish with migration of group_permissions module
Comment #22
ressaThanks for starting working on this in 2018 @LOBsTerr! Ideally, it shouldn't be necessary to add a module to get what is the expected behavior, in my mind. It surprises me that this behavior has been the default for this long, maybe always? So I hope this issue can move forward, perhaps by focusing on fixing the redirect to the group after joining or creating in this issue, and fix the messages in a separate issue, as suggested in #13?
Comment #23
ericmulder1980 commentedWell it took us 5 years to get to this point. I would suggest we first fix a broken system before we try to improve it. Currently the redirect Url in 3.x is based on the following logic. I really don't want to create a new issue for the 3.x branch so i changed the version of this issue.
So the default behaviour is that you will probably never be redirected to the group page. I can't really see a business case where you would not have the "View individual group members" permission OR where you don't have the permission to view your own user page. This logic works very well if you add a node or other entity relation to a group but not for group memberships.
We can turn this issue into a massive change with configurable redirect paths per group type but that will only further delay the solution of this issue. I think for now we need to make a special flow when we are adding a group membership relation. For all other entity types we can keep the logic as is.
Please check attached patch for the 3.x version.
Comment #24
ericmulder1980 commentedSomehow a use statement fell off. New patch provided.
Comment #25
kristiaanvandeneyndeThis has been annoying me for quite some time too, but I just have never gotten around to it. It's definitely on my list to commit some day, but I feel like we might want to put this logic in a new type of plugin handler that defaults to the current behavior, but can deviate on a per plugin basis.
Edit: hid the patch by cross-posting :/
Comment #26
diaodiallo commentedThank you @ericmulder1980 I spent almost half a day with this issue and your small code is working perfectly for me.
Changing the status so more user can test and confirm.
Comment #27
matslats commentedIf I try to redirect in an hook_form_group_relationship_form_alter hook, my redirect is overwritten.
Method GroupRelationshipForm::Save is should check for existing redirects before overwriting them
in fact this is the redirect I would like.
Comment #28
dercheffeThe Patch in #25 works in 2.2 as well as far I could test.
Comment #29
hitchshockComment #31
hitchshockThe issue is still relevant.
I updated #23 patch to make it compatible with 3.3.x and made an MR.
From my side RTBC, cuz it works well.
Comment #32
nagy.balint commented#31 works for me
For me it was an issue where I created a new group, and after going through an extra membership form (which I think is also a UX issue), I got redirected to the membership entity, and not to the group.