Off-shoot from #626286: Make contextual links a module:

When one installed module registers a permission, and you install another module that registers the same permission, then the module installation fails, because User module tries to insert all of the module's permissions as raw database query instead of using its own user role API functions.

This situation can happen more often than you think, because two related but otherwise independent modules can implement the same or common permission.

Comments

Status: Needs review » Needs work

The last submitted patch failed testing.

sun’s picture

Status: Needs work » Needs review
StatusFileSize
new1.15 KB

errrr. Silly me.

sun’s picture

Let's see whether we are able to test this.

This patch is expected to fail.

dries’s picture

Just when you want a test to fail, it doesn't. :)

sun’s picture

Damn. It passes, because the system_test is installed during setUp, where also system module is installed, and since the permissions of the installed modules are merged, the error is not triggered.

I spent some time tinkering about whether we can test this somehow, but we'd have to go through heaps to do so. We would need to "un-hide" a testing module that contains an already existing permission, so we can enable it on the modules page, because only when installing modules iteratively, this bug is triggered.

So I think we should just commit #2.

sun’s picture

Status: Needs review » Reviewed & tested by the community

Let's put this in the RTBC queue and see whether someone has strong objections.

Status: Reviewed & tested by the community » Needs review

Re-test of drupal.user-modules-installed.3-test-only.patch from comment #3 was requested by webchick.

sun’s picture

Status: Needs review » Reviewed & tested by the community
webchick’s picture

Status: Reviewed & tested by the community » Fixed

Looks like there is indeed no easy way to test this, but this shouldn't hold up the bug fix.

Committed #2 to HEAD.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.