Problem/Motivation

The "social_group_selector_widget" field widget which is used for selecting a group on the event/topic creation page supports only node entity type.

Steps to reproduce

  1. Create a field widget based on the "social_group_selector_widget" widget and extend the returned list of the "types" method by the "media" item.
  2. Enable the Group Media module and create the "File" bundle with the "Group" field (similar to a field with the same name from topics and events) based on created field widget.
  3. Navigate to the "/admin/group/types/manage/flexible_group/content" page and install the "Group media (File)" plugin.
  4. Add the "hook_social_group_linked_type" hook to your module. This hook should return the name of the entity type - media.
  5. Log in as "User 1" and create the "Group 1" flexible group with the "Group members" visibility.
  6. Create the "Group 2" flexible group with the "Community" visibility.
  7. Log in as "User 2" and create the "Group 3" flexible group.
  8. When you navigate to the creation page of the media entity type of the "File" bundle then you should see the "Group" field.
  9. When you open the values drop-down list of the "Group" field then you should see the "Group 2" item and you shouldn't see the "Group 1" item.

Proposed resolution

Add a new method (the "types" method) to a class of this widget which provides a list of supported entity types. By default, this list contains only the node entity type to be backward compatible.

Comments

chmez created an issue. See original summary.

ohorbatiuk’s picture

Status: Active » Needs work

PR work in progress here.

ohorbatiuk’s picture

Assigned: ohorbatiuk » Unassigned
Issue summary: View changes
Status: Needs work » Needs review
StatusFileSize
new13.4 KB
ohorbatiuk’s picture

Issue summary: View changes
damienmckenna’s picture

Should this include some configuration to match what is listed in the issue summary?

tbsiqueira’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.