You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 18, 2024. It is now read-only.
Because the default roles are granted in front, they will check if the default roles exists. Because of the og_roles_permission, these don't exists and are only copied afterwards. Thus the default roles aren't added on groups that don't have the og_roles_permissions to false.
Possible solution:
index f7fe300..5ac68a2 100755
--- a/og.module+++ b/og.module@@ -851,7 +851,7 @@ function og_entity_insert($entity, $entity_type) {
$name = 'og_group_manager_default_rids_' . $entity_type . '_' . $bundle;
if ($rids = variable_get($name)) {
foreach ($rids as $rid) {
- og_role_grant($entity_type, $id, $entity->uid, $rid);+ og_role_grant_force($entity_type, $id, $entity->uid, $rid);
}
}
}
@@ -3053,7 +3053,26 @@ function og_role_grant($group_type, $gid, $uid, $rid) {
// Role isn't valid.
return;
}
++ og_role_grant_force($group_type, $gid, $uid, $rid);+}+/**+ * Grant a group role to a user forcefully.+ *+ * @param $group_type+ * The entity type of the group.+ * @param $gid+ * The group ID.+ * @param $uid+ * The user ID.+ * @param $rid+ * The role ID.+ *+ * This will not check if the role already exists.+ * Is usefull for when roles aren't copied yet from the default roles, permission.+ */+function og_role_grant_force($group_type, $gid, $uid, $rid) {
// Get the existing user roles.
$user_roles = og_get_user_roles($group_type, $gid, $uid);
if (empty($user_roles[$rid])) {
The text was updated successfully, but these errors were encountered:
Because the default roles are granted in front, they will check if the default roles exists. Because of the og_roles_permission, these don't exists and are only copied afterwards. Thus the default roles aren't added on groups that don't have the og_roles_permissions to false.
Possible solution:
The text was updated successfully, but these errors were encountered: