0

I have added user roles and permissions to feature which I use to featurize general site configurations and theme settings.

In the past I believe this worked just fine, however, with my latest push the remote created additional roles instead of changing the names as I had done on dev. I deleted the old roles and kept the ones with the proper names. MySQL drupal.role shows that the roles now have new IDs also which I believe could be the cause of the problem. I shouldn't have deleted the roles that matched dev but since I already did, where do I go from here? Should I manually change the ID's in MySQL?

I'm working on a new site that isn't launched yet but will be importing users from another site.

Here you can see the original role IDs and what is on dev: enter image description here

Here you can see the role ID's on prod now:

enter image description here

  • This can be a pain for sure. I'd change the rid's in dev to match prod, then export your feature and you should be good to go. – longboardnode Apr 24 '17 at 4:03
  • I believe there is an add on module for Features for handling roles and permissions better than core features. – Kevin Apr 24 '17 at 9:24
  • 1
    @Kevin is this the module and any experience with how would it handle a role rid discrepancy? – longboardnode Apr 26 '17 at 17:24
0

Since production hasn't yet been released and is still under development, I took a risk of mysqldump the drupal.role table and then importing them on prod, which fixed the issue.

LongBoardNode's suggestion of editing the RID on dev would have probably been a better idea,

|improve this answer|||||
  • Did you also import the role_permissions table as well? It is tied to the the roles table and references rid's from the roles table. I'm fairly sure importing only the role table will break your permissions on prod – longboardnode Apr 26 '17 at 4:39
  • I didn't import the role_permissions table. Once I reimported the roles table, the permissions adjusted appropriately. I have a role sync module that re-synced the important ones and the other roles are only a handful of people, which I will reassign by hand. – Christia Apr 26 '17 at 18:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.