user cannot see custom entity on view if attached to group

Created on 18 April 2022, over 2 years ago
Updated 30 March 2023, over 1 year ago

Problem/Motivation

if i have a custom entity that i have made a plugin for and attached to a group, a user that does not have Bypass group access control cannot see the entities in a view although they can see the entities on their own.

Steps to reproduce

  • create a custom entity. create a plugin so that they can be attached to groups as per the instructions here: https://drupal.stackexchange.com/questions/259674/how-to-add-custom-enti...
  • install and enable entity group field module .
  • add content of this type of entity and do not add a group - the user without this permission mentioned above can see it in a view of the entities
  • edit the content and add a group to it. - the user can no longer view it in the view but can still edit and view the entity
  • a user with admin permissions including Bypass group access control can see it in the view.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States dianacastillo Miami

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡¦πŸ‡«Afghanistan ab.shakir

    The annotation in the content enabler plugin should include the handler part. This is actually missing from the instructions mentioned in the issue summary above. Your annotation must look like:

    /**
    * Provides a content enabler for user entities.
    *
    * @GroupContentEnabler(
    * id = "group_entity_user",
    * label = @Translation("User"),
    * description = @Translation("Adds users to groups as pure entities and not as members."),
    * entity_type_id = "user",
    * entity_access = TRUE,
    * pretty_path_key = "user",
    * reference_label = @Translation("Username"),
    * reference_description = @Translation("The name of the user (entity) to add to the group (not as a member)"),
    * deriver = "Drupal\module_name\Plugin\GroupContentEnabler\UserEntityDeriver",
    * handlers = {
    * "access" = "Drupal\group\Plugin\GroupContentAccessControlHandler",
    * "permission_provider" = "Drupal\group\Plugin\GroupContentPermissionProvider",
    * }
    * )
    */

Production build 0.71.5 2024