Add variable "joined" for medium teaser view mode

Created on 10 February 2024, 11 months ago
Updated 5 March 2024, 10 months ago

Problem/Motivation

We must differentiate between group members and non-members at the newly created medium teaser view mode on social_group.

Unfortunately, hook_preprocess_group() implemented at social_group_preprocess_group() has a partial implementation of this feature, where here it defined "joined" as FALSE but never changed its value. https://github.com/goalgorilla/open_social/blob/main/modules/social_feat...

This causes our templates to have a "NULL" value thus we cannot verify it in our new teaser template.

https://git.drupalcode.org/project/socialbase/-/merge_requests/201/diffs...

This is also an old bug because group--teaser.html.twig depends on this variable ( joined ) to display a small box on the group overview page.

This value is altered by the following plugin https://github.com/goalgorilla/open_social/blob/main/modules/social_feat... but this fails at the teaser view mode because social_group_preprocess only calls that plugin on hero, statistics view modes.

This variable is also used here https://git.drupalcode.org/project/socialblue/-/blob/2.4.x/templates/gro...

We must check if a user is a member of a group at social_group_preprocess_group(), and update that variable accordingly.

Steps to reproduce

  • Log in to Open Social as any user
  • Go to group overview page here /all-groups
  • Join any group and go back to the group overview page, you should see a "You have joined" label on the page.
✨ Feature request
Status

Fixed

Version

12.1

Component

Front-End

Created by

πŸ‡ΊπŸ‡¦Ukraine v.koval

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024