Exporting IDs as opposed to role names themselves can make things difficult when moving an exported flag to a different environment. I've attached a patch which generates a suggested export output.

CommentFileSizeAuthor
flag.export.inc_.patch847 bytesjustafish

Comments

quicksketch’s picture

A user can change a role name *at any time* (such as to change "admin" to "administrator" or some other innocent change), which makes this change seem like a step backwards. It seems that such a situation is just as common (if not more so) as users attempting to deal with different role IDs between environments.

justafish’s picture

Yes!
The reasoning was 2 things though. Firstly that Features exports roles as just names without IDs attached in both role and permission exports, and secondly that KIT specifies particularly named user roles that must be accounted for. Obviously that breaks down with additional roles and is only applicable to the Features module. Maybe Features should just be exporting Role IDs along with names...

lpalgarvio’s picture

i think that machine names or names is preferable to IDs.

quicksketch’s picture

Status: Active » Needs work

Okay, I'm reconsidering this change, but the patch looks incomplete. Just exporting as role names doesn't help with importing them again does it? I don't think this would work with our implementations of hook_flag_default_flags() either.

rylowry@gmail.com’s picture

I am having this problem in the 7.x version. I'm moving a feature with several flags between different environments. The ids are different in both environments, so the feature is not fully functional out of the box. Could the uuid module help in this situation?

nedjo’s picture

I posted a related handbook documentation page, Exportables and user role IDs in features.

joachim’s picture

I think this might be a better solution: #1700134: move flag access out of the flag object storage and to regular user permissions.

That way, all modules solve the problem of exportable permissions in one go.

joachim’s picture

Status: Needs work » Closed (won't fix)

Closing as wontfix. I think the correct fix for this problem is to use permissions for flags.

lpalgarvio’s picture

that would be better joachim =)