Jump to:
| Project: | Menu attributes |
| Version: | 7.x-1.0-rc2 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Issue Summary
Drupal 6 version: version = "6.x-2.0-beta1"
Drupal 7 version: version = "7.x-1.0-rc2"
Ran upgrade php in D7 with no modules (ran with no pending update success) then installed the modules and ran again.
Update #7001
Failed: PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'module' cannot be null: INSERT INTO {role_permission} (rid, permission, module) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2); Array ( [:db_insert_placeholder_0] => 4 [:db_insert_placeholder_1] => administer menu attributes [:db_insert_placeholder_2] => ) in user_role_grant_permissions() (line 3034 of /home/trunk-7/modules/user/user.module).
Code that is not running:
/**
* Grant the 'administer menu attributes' permission to roles that currently
* have the 'administer menu' permission.
*/
function menu_attributes_update_7001() {
$roles = user_roles(FALSE, 'administer menu');
foreach ($roles as $rid => $role) {
user_role_grant_permissions($rid, array('administer menu attributes'));
}
return t("Every role with the 'administer menu' permission has also received the 'administer menu attributes' permission.");
}Anybody else having issues with this part of the upgrade?
Comments
#1
Having this exact problem today on D7.
#2
It seems that the module "Menu Attributes" was not enabled. So I turned it on and the update ran just fine. For what it's worth....
#3
For the record, this isn't limited to D6 -> D7 updates. I just experienced it upgrading from 7.x-1.0-rc1 to rc2.
Yes, my module was disabled. Enabling the module enabled the update. Jeremyr saved me a whole lot of head scratching; thanks!
#4
Glad I helped you out. We updated a number of D7 sites today and only one out of +/-50 had this issue.
#5
Hm.. so this is fixed then?
#6
amateescu: what data are you using to change this status to "fixed"?
#7
Comments #2 and #3.
#8
This thread indicates that we have a work-around, not a solution. Unless we expect disabled modules to throw errors? I've set this back to active.
#9
Ok, as you wish :)
#10
Had the same issue. In my case, it was also because the module was off. Turning it back on resolved the issue.
I agree with screenack's point that I wouldn't have expected to see this error given that the module was disabled.
#11
I think the problem is a documentation issue at this point. If modules are disabled the code to update them can't run when needed. There are core discussions on this and ultimately, the instructions to disable modules before updating them may currently be a misleading and unneeded step.
#12
didn't mean to switch status.