open_social icon indicating copy to clipboard operation
open_social copied to clipboard

Issue #3280216 by colan: "Please log in or sign up to comment" is displayed to authenticated users

Open colans opened this issue 2 years ago • 4 comments

Problem

After upgrading to Open Social 11, authenticated users are seeing "Please log in or sign up to comment", which makes no sense because they're already logged in.

This is being caused by the changes made for #3251540: Access to comment same as fo the commented entity. It was assumed that only anonymous users shouldn't get the comment form, which doesn't take into account authenticated users who aren't in the group.

Solution

There are several options if the user is already logged in:

  1. Do nothing.
  2. Display a more appropriate message like "Please join the group to comment."
  3. Have checkbox allowing admins to decide which one they'd prefer.

The PR is now doing (2), but after discussing with my client, it's too noisy so we need to be able to turn off these messages. So I'd be fine with (1) or (3).

  • [ ] Choose a messaging type (show a message, don't, or make it configurable)

Issue tracker

"Please log in or sign up to comment" is displayed to authenticated users

How to test

  1. [ ] Create an open group.
  2. [ ] Add group members.
  3. [ ] Have group members add some content.
  4. [ ] Create a user without placing her in the group.
  5. [ ] Have her log in and view the content.
  6. [ ] She should not see: "Please log in or sign up to comment".

Definition of done

Before merge

  • [ ] Code/peer review is completed
  • [ ] All commit messages are clear and clean. If applicable a rebase was performed
  • [ ] All automated tests are green
  • [ ] Functional/manual tests of the acceptance criteria are approved
  • [ ] All acceptance criteria were met
  • [ ] If applicable (I.E. new hook_updates) the update path from previous versions (major and minor versions) are tested
  • [ ] This pull request has all required labels (team/type/priority)
  • [ ] This pull request has a milestone
  • [ ] This pull request has an assignee (if applicable)
  • [ ] Any front end changes are tested on all major browsers
  • [ ] New UI elements, or changes on UI elements are approved by the design team
  • [ ] New features, or feature changes are approved by the product owner

After merge

  • [ ] Code is tested on all branches that it has been cherry-picked
  • [ ] Update hook number might need adjustment, make sure they have the correct order
  • [ ] The Drupal.org ticket(s) are updated according to this pull request status

Screenshots

[Required if new feature, and if applicable] If this Pull Request makes visual changes then please include some screenshots that show what has changed here. A before and after screenshot helps the reviewer determine what changes were made.

Release notes

[Required if new feature, and if applicable] A short summary of the changes that were made that can be included in release notes.

Change Record

[Required if applicable] If this Pull Request changes the way that developers should do things or introduces a new API for developers then a change record to document this is needed. Please provide a draft for a change record or a link to an unpublished change record below. Existing change records can be consulted as example. Please provide a draft for a change record or a link to an unpublished change record below. Existing change records can be consulted as example.

Translations

[Optional]Translatable strings are always extracted from the latest development branch. To ensure translations remain available for platforms running older versions of Open Social the original string should be added to translations.php when it's changed or removed.

  • [ ] Changed or removed source strings are added to the translations.php file.

colans avatar May 12 '22 19:05 colans

I just added some other options for the type of messaging (don't show a message or make it configurable) as we need to be able to turn it off (after discussion with my client). So this has to be decided before we can more ahead on this. Thoughts?

colans avatar May 13 '22 18:05 colans

Function doc comments go against the Clean Code principles when there's no value added, but I'll play along as the Drupal coding standards haven't caught up yet.

colans avatar May 18 '22 16:05 colans

@tbsiqueira Looks like a Composer build problem with the branch, not the code here. Same problem as in https://github.com/goalgorilla/open_social/pull/2932

colans avatar May 18 '22 19:05 colans

Hi @colans

I have tried to reproduce the issue and I see this text:

You are not allowed to comment on content in a group you are not member of.

fbf5ced170ea10043b46ba334275452e

HTT:

  • Create an open group.
  • Add group members.
  • Have group members add some content.
  • Create a user without placing her in the group.
  • Have her log in and view the content.

Let me know if I do something wrong.

Ressinel avatar May 27 '22 07:05 Ressinel

Closing PR due to inactivity, please feel free to reopen if still relevant

tbsiqueira avatar Oct 17 '22 11:10 tbsiqueira