We have a module managing global permissions for our multisite Drupal platform. One of the challenges we've been wrangling with is our features module coming into a "permanently overridden" state in which reverting the feature does nothing.

Our fix was to remove the addition of the "module" key to the output generated from user_permission_features_export_render(). I've dug through the feature code and ran several tests and have not found any adverse effects of this removal. (created clean 7.x install, activated feature, activated a few modules which are covered, verified that the permissions were being assigned)

Here is a patch against 7.x-1.0-rc1. Looking at the latest dev, I am seeing from #1305048: Undefined index error in user_permission_features_export_render() a bit more modification around this line, so I thought it best to just create the patch against rc1.

CommentFileSizeAuthor
#1 features-1556110.patch504 bytesreubenavery

Comments

reubenavery’s picture

StatusFileSize
new504 bytes

The patch

frankcarey’s picture

This setting of the 'module' associated with a permission didn't happen in 6.x, and doesn't look like it's being used for anything in 7.x. We're providing a hook_permissions() that basically provides disabled permissions on behalf of disabled modules. if a module is disabled that supplied a permission, we don't loose them when doing a new export. The worked well in 6.x, but In 7.x, the custom permission module ends up taking over "ownership" in features' eyes and the feature ends up overridden, when it really shouldn't be.

Anyone know why the module was added to the export in the first place?

hefox’s picture

Status: Active » Needs work

The module information is needed when reverting/rebuilding permissions, but it can be looked up at that point, (having it in the export is repetitive information). Core needs it due to disabling vs. uninstalling problems (I recall the issue). So update revert/rebuild to add in module, and should be good.

frankcarey’s picture

Yeah, that flow doen't work so awesome when you have a platform of sites and want to export all permissions, even for modules that might be turned off. I'd like to know more about what issue necessitated adding that info into the export if you can recall.