Problem/Motivation

og_moderation_clone_access_alter() was not completely fixed. The following bugs remain:

  • It only works for node entity groups, although any entity type can be made a group.
  • It only checks the first group that a node is assigned to, although a node may be assigned to multiple groups.
  • It only works if the og_group field is named og_group_ref, although the og_group field may have any name, and there can even be multiple og_group fields with different names on the same node.
  • The function description says it implements hook_TYPE_alter().
  • This is a menu access hook, not a node access hook. There is no reason to use node access constants.

Proposed resolution

Use og_get_entity_groups() to get all a node’s groups regardless of group entity type or og_group field names. Format the function as recommended by hook_clone_access_alter().

Remaining tasks

Contributor tasks needed
Task Novice task? Contributor instructions Complete?
Create a patch Instructions
Add automated tests Instructions
Manually test the patch Novice Instructions
Add steps to reproduce the issue Novice Instructions
Embed before and after screenshots in the issue summary Novice Instructions
Review patch to ensure that it fixes the issue, stays within scope, is properly documented, and follows coding standards Instructions

Comments

Darren Oh created an issue.

joelpittet’s picture

I don't think any entity type can be cloned though through node clone module, is this maybe why?