Closed (duplicate)
Project:
Drupal core
Version:
8.0.x-dev
Component:
user system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
21 Jan 2010 at 23:36 UTC
Updated:
29 Jul 2014 at 18:37 UTC
Porting or referencing roles across multiple sites is a pain because roles are ID'ed using an auto-increment integer. This also makes making roles exportable more or less impossible.
Roles should be ID'ed using a machine name similar to content types.
Comments
Comment #1
dave reidYep, makes sense, but definately for D8 now.
Comment #2
nvanhove commentedI would prefer a situation where *all* primary keys in the database would be UUID()'s instead of machine names.
This would truly create a system where we can export features & content.
Comment #3
arhak commented@#1 I don't think that makes sense, otherwise remove every numeric ID for its machine name.
and still, what about nids?
@#2 the MSSQLServer approach might help a lot when migrating/exporting/synchronizing
nevertheless, exporting tools might come up with an algorithm similar to what Symfony calls "fixtures"
which is saving the data keyed by a "candidate key" (even composed keys) instead of the actual primary key
that way you can always import the data without primary keys conflicts
and there is no lost, since almost every table has at least one candidate key besides the primary key
therefore, references work as well
the only problem would come up if there is a table with only a primary key and no candidate key, but in that case the original proposal of this issue wouldn't work either (and that data shouldn't be that relevant to represent a big impediment when migrating/exporting)
Comment #4
dixon_@arhak: I really think it makes sense to have machine readable names for roles, vocabularies, content types, input formats etc. as those are *configuration*. Nodes, users and terms etc. are *content* where it makes sense to have serial numbers.
Configuration should be exportable.
Comment #5
arhak commented@#4 good point
but take for example ImageCache with its presets indexed by machine name, deleting a preset and creating another one in the future with the same name might bring back old permission previously assigned and never reseted (if the permissions are never re-submitted they aren't dropped)
having that with roles would be too risky
it seems to me that indexes other than machine names would be needed,
there is no need to rediscover why the wheel is rounded, and there are good reasons for having serial or GUID primary keys despite the fact that the table has more candidate keys (even when candidate keys aren't composed ones)
Comment #6
gddTagging so this can be tracked as part of the configuration management initiative
Comment #7
Tor Arne Thune commentedSubscribing. I would love to see machine names as IDs for roles, for the reason described in the OP.
Comment #8
duaelfrI fully approve this initiative as I am facing issues with Workflow and Views Features integration...
Comment #9
neochief commentedI think it's duplicate of #935062: Change role id to machine name
Comment #10
gddAh yes, that is the right one. Thanks.