Closed (duplicate)
Project:
Recruiter Features
Version:
7.x-1.0-rc1
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
23 Oct 2012 at 07:30 UTC
Updated:
7 Feb 2013 at 02:24 UTC
Hi!
Thanks for releasing these features. I'm currently trying to add them to a site running Drupal 7.16 running Rules 7.x-2.2 and Features 7.x-1.0.
It seems that module installation fails when Drupal tries to enable new permissions for the Administrator role. The SQL queries fail when Drupal doesn't provide the module name that's required by the role_permission table. Role 3 is the default Administrator role and access rules link job_unpublish is a Role that apparently was exported using Features from the Rules module.
I'm not sure if the issue occurs on Export or whether you can tweak something so that the Import script gets the proper information.
Notice: Undefined index: access rules link job_unpublish in user_role_grant_permissions() (line 3041 of /webserver/quick-drupal-20121023071359/drupal/modules/user/user.module).
PDOException: SQLSTATE[23000]: Integrity constraint violation: 19 role_permission.module may not be NULL: INSERT INTO {role_permission} (rid, permission, module) VALUES (?, ?, ?); Array ( [0] => 3 [1] => access rules link job_unpublish [2] => ) in user_role_grant_permissions() (line 3043 of /webserver/quick-drupal-20121023071359/drupal/modules/user/user.module).
Comments
Comment #1
svenryen commentedThis note might be useful:
http://drupal.org/node/1063204#comment-6478704
Perhaps you can export the Rules and Permissions to a separate module to see if it helps?
Comment #2
mh86 commentedThanks for posting this issue and the link to the issue in the Feature's issue queue.
We've experienced similar problems on a few sites already, and the current permissions system is really ugly (it should be more robust for such cases).
Exporting them in two different modules would theoretically work, but I really don't want to do that. I makes the features development workflow more complicated and the feature module is more or less incomplete without the permissions.
We'll try the patch from #1063204: Adding a new permission causes integrity constraint violation. If it helps, we can include the patch in the make file of the distribution.
Comment #3
svenryen commented@mh86 - thanks for such a quick response! yes, i can certainly see why that would be a mess.. You'd need a separate Rules and Permissions module for each one of your sub modules.
I tried patch #32 from that issue node already (for import) and it didn't help. It seems that on export, Rules didn't provide everything needed to import, so the pain point probably lies with export of Rules. The bug is triggered by Drupal's helpful addition of all available permissions to the Admin user (a workaround would be to comment out that part while enabling the Recruiter features).
Comment #4
mh86 commentedSmall correction: the problem is actually related to Rules Links, which exposes separate permissions for each link configuration.
Comment #5
mh86 commentedand one more question: are you using the Recruiter distribution or do you have your own installation and added the Recruiter features module?
Comment #6
svenryen commentedI can't remember. Sorry, I didn't notice your follow up. Believe it was the module and not the distribution
Comment #7
dasjoplease have a look at #1905464-2: Upgrade failure - Integrity constraint violation: 1048 Column 'module' cannot be null and lets mark this as a duplicate if it fixes the problems stated above
Comment #8
svenryen commentedYes, I haven't tested though it seems to be the same issue. Thanks!