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
Comment #1
jeremyr CreditAttribution: jeremyr commentedHaving this exact problem today on D7.
Comment #2
jeremyr CreditAttribution: jeremyr commentedIt 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....
Comment #3
Screenack CreditAttribution: Screenack commentedFor 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!
Comment #4
jeremyr CreditAttribution: jeremyr commentedGlad I helped you out. We updated a number of D7 sites today and only one out of +/-50 had this issue.
Comment #5
amateescu CreditAttribution: amateescu commentedHm.. so this is fixed then?
Comment #6
Screenack CreditAttribution: Screenack commentedamateescu: what data are you using to change this status to "fixed"?
Comment #7
amateescu CreditAttribution: amateescu commentedComments #2 and #3.
Comment #8
Screenack CreditAttribution: Screenack commentedThis 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.
Comment #9
amateescu CreditAttribution: amateescu commentedOk, as you wish :)
Comment #10
cmsdave CreditAttribution: cmsdave commentedHad 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.
Comment #11
VM CreditAttribution: VM commentedI 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.
Comment #12
VM CreditAttribution: VM commenteddidn't mean to switch status.
Comment #13
okokokok CreditAttribution: okokokok commentedSame issue on 2 sites. Enabling the module and then running the upgrade fixed it.
Comment #14
manoloka CreditAttribution: manoloka commentedI can confirm that 2# solved it for me too
Comment #15
morphosis7 CreditAttribution: morphosis7 commentedSame thing here - ran into error, found this thread, enabled the module, and now the update worked.
In lieu of changes to the overall upgrade instructions, could an UPGRADE.txt or README.txt file be put within this module to advise others of this issue and the workaround? Or at least a pointer to this thread? From what I've seen (for example at https://drupal.org/node/948216 ) that's the way site owners are advised to check for the needs of a given module that may vary from what is expeted.
I'd be happy to write something such as what I'm suggesting, if the module maintainers think it would be a good idea.
Comment #16
gaurav.goyal CreditAttribution: gaurav.goyal commented#2 worked for me too. thanks jeremyr..:)
Comment #17
gurunathan CreditAttribution: gurunathan commented#2 worked for me
Comment #18
joelpittetI'm marking this as fixed from the last set of comments. Let me know if the steps to reproduce still cause this upgrade error.
Comment #20
localnetwork CreditAttribution: localnetwork as a volunteer and commented#2 worked for me.