I will supply a patch that implements a plugin for the og_migrate module to migrate permissions from system-wide table for legacy drupal6 OGUR roles to newly created og_roles. This makes some assumptions:
1. In drupal6, the roles were system wide roles, so the permissions will be applied across all og bundles.
2. In drupal7 there are two hard coded og roles ADMINISTRATOR MEMBER and MEMBER that will replace any "configured" roles from drupal6.
3. This plugin depends on og_7200_ogur plugin.
Should this functionality reside in the og_7200_ogur plugin instead? According to, http://drupal.org/node/967686 , there was a change in $op where edit was changed to update for permissions. Not sure if my approach is best to accomodate this.
I'll upload my patch once the issue is created and I have my numbers. Thanks.
Comment | File | Size | Author |
---|---|---|---|
#7 | og-ogur_permissions_migration-1611834-7.patch | 5.71 KB | pgillis |
#5 | og-ogur_permissions_migration-1611834-5.patch | 5.03 KB | pgillis |
#3 | og-ogur_permissions_migration-1611834-3.patch | 5.04 KB | pgillis |
#1 | og-ogur_permissions_migration-1611834-1.patch | 4.43 KB | pgillis |
Comments
Comment #1
pgillis CreditAttribution: pgillis commentedComment #2
amitaibuLets add an access callback for OGUR that checks if those tables even exist.
Do we really need the order?
elseif and else should be in a new line.
This can be in oneline
strpos(...) === 0
Let's chain it in separate lines.
->countQuery()
->execute()
...
what is this $role->r_rid?
better call it $roles, not $og.
elseif should be line below.
false => FALSE
Comment #3
pgillis CreditAttribution: pgillis commentedI believe I have addressed all your concerns from #2. I've also finally found the drupal code validator for eclipse, so hopefully no more formatting issues!
I have renamed the column legacy_rid. Does that make sense? Thanks!
Comment #5
pgillis CreditAttribution: pgillis commentedI need to get my git configured better!
Comment #6
amitaibuGetting closer :)
Enough to do return db_table_exists('d6_og_users_roles');
Let's also add this access callback to og_7200_ogur
Please add docs.
No need for another variable, just populate $context['sandbox']['max'] directly
I think you are missing a space here, after
update
?Comment #7
pgillis CreditAttribution: pgillis commentedI have incorporated your comments from #6.
I have added documentation for the code that populates list of legacy roles, I think what I had previously was going to potentially miss some roles.
I don't need a space because it is already in the existing permissions. If you think it would be clearer I could add the space and pass 5 to substr.
Comment #8
pgillis CreditAttribution: pgillis commentedComment #9
amitaibuI've cleaned a bit (weird line breaks), and committed -- thanks!
Comment #10
pgillis CreditAttribution: pgillis commented