Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Member Groups for EE6 #169

Closed
dougblackjr opened this issue Apr 13, 2021 · 1 comment
Closed

Fix Member Groups for EE6 #169

dougblackjr opened this issue Apr 13, 2021 · 1 comment

Comments

@dougblackjr
Copy link

EE6 moved from Member Groups to Roles and Permissions:

Looking at this line:

ee()->db->delete('module_member_groups', array('module_id' => $query->row('module_id')));

This will break when uninstalling in EE6. Changing this to exp_module_member_roles will make it EE6 ready.

Happy to PR this with a version check; just would need to know how you would want to go about that, so it can check whether it would be EE5 or EE6 (i.e. an add-on version check? Checking EE's APP_VER constant?)

@croxton
Copy link
Owner

croxton commented Apr 13, 2021

Yes please go ahead and make a PR. You can use APP_VER to determine which EE version is in use, e.g.:

if (version_compare(APP_VER, '6.0', '>=')) {
   ee()->db->delete('module_member_roles', array('module_id' => $query->row('module_id')));
} else {
   ee()->db->delete('module_member_groups', array('module_id' => $query->row('module_id'))); 
}

croxton added a commit that referenced this issue May 8, 2021
@croxton croxton closed this as completed May 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants