I got an error message when running update.php after I got the module updated from 2.x to 3.x., so the updating was not successful.
The following updates returned messages
flag module
Update #7305
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] => 2 [:db_insert_placeholder_1] => flag bookmarks [:db_insert_placeholder_2] => ) in user_role_grant_permissions() (line 3058 of C:\wamp\www\mysite\modules\user\user.module).
Comments
Comment #1
joachim commentedThat's weird.
Had you just installed new modules? What were your exact steps before and during the update process?
Do you have any modules that extend Flag?
Comment #2
DrupalDan commentedHi joachim, thank you for your response. I just tried the latest dev version, and during the update process I didn't run into any trouble and it went pretty smoothly. I don't know if that's because of any new change made to this version or just how I did it: this time I uninstalled the early version completely and did a fresh installation, while last time I just removed the module folder and copied and pasted the dev version.
Thanks!
Comment #3
joachim commented> this time I uninstalled the early version completely and did a fresh installation, while last time I just removed the module folder and copied and pasted the dev version.
You shouldn't have to uninstall, and that will have lost all your flag data, so that's definitely not the procedure we want to recommend.
Could you try it with the normal update procedure please?
Comment #4
joachim commentedI've just run an update from flag 2.x to flag 3.x and all worked fine -- including all my flag roles being correctly updated to permissions.
You're not going from 6x2x right to 7x3x by any chance? That would definitely cause problems.
Comment #5
DrupalDan commentedMy production site (D7) is using 2.0. Before I move to make the update there I tried the updating at my local site, which allows me to uninstall it with data gone. I just tried it again (replace existing module folder with the new one, without uninstalling it), but unfortunately I got the same error when updating. Wondering why...
Comment #6
joachim commentedDid you update any other modules at the same time?
Comment #7
DrupalDan commentednegative. To rule this out I run update.php before trying to update the module, and the first updating shows no pending updates, and after that I remove the 2.0 module folder, copied and pasted the 3.x dev in there, and then run update.php again.
There are 6 pending updates (screenshot attached), and only the other 5 got updated.
Comment #8
joachim commentedIs there anything weird about your flag setup? Any modules that extend flags? Any weird flags?
Comment #9
micromegas commentedI ran into the same error when I upgraded from 7.x-2.0 to 7.x-3.0-alpha4. My site is using View Flag Refresh (enabled), and I also have Flag Weights (disabled) which is not being used. The site is a local development site on my OS X laptop, using MySQL and the version of Apache bundled with OS X.
LOCATION h ttp://DOMAIN/update.php?op=selection&token=TOKEN&id=ID&op=do
REFERRER h ttp://DOMAIN/update.php?op=selection&token=TOKEN&id=ID
MESSAGE 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] => 2 [:db_insert_placeholder_1] => flag assign [:db_insert_placeholder_2] => ) in user_role_grant_permissions() (line 3058 of /Users/USER/Sites/SITE/modules/user/user.module).
Here were the exact steps that I took to upgrade:
After upgrading to 7.x-3.0, I notice that there are permissions listed for Flag/Unflag Node Entity as XYZ. When I went back to a prior version of the site still on Flag 7.x-2.0, these permissions were not present (as in, the entries were not even listed, all that it showed was "administer flags" and "use flag importer"); the flags were working normally and users were able to flag/unflag the content after the appropriate permissions had been set within the flag itself.
After upgrading, these additional Flag/Unflag Node Entity as XYZ permissions entries appeared, with no values set, and the users could not flag/unflag content; I had to set permissions again to allow this.
Comment #10
bharata commentedDrupalDan and micromegas, did either of you resolve this issue? Update #7305 returns errors for me as well and I would love to know if you found a way to use the 3x branch. Perhaps my issue is related even though it has arisen while trying to install 7.x-3.0-rc1.
If you have had any luck, please pass it on...
Thanks!!
Comment #11
joachim commented> disable the flag module
That could be your problem. You should not be disabling the module you are trying to upgrade!
Comment #12
micromegas commented@bharata: the error wasn't a big deal; I just re-built the user permissions (it was a test site with only a few roles) and it was good to go.
Comment #13
bharata commentedI made the "disable the flag module" mistake also. I then made the mistake of attempting to completely un-install the 2x Flag module by disabling the module, removing the module folder then running update.php. apparently this is not how one "completely removes" a module as this still did not avoid the error and when I searched my database for tables titled flag* and found several. I manually dropped those and tried again to install 3x but still did not avoid the error. I then tried to re-install 2x and that failed too. I ended up going back to a backed-up state from just before ever attempting any changes to the module. This time I simply navigated to update.php, replaced 2x files with 3x files, clicked "continue" and everything went just fine.
Lessons:
un-install then re-install = bad
disable then add new files = bad
Go to update.php, replace files then continue = GOOD!
Thanks!!
Comment #14
joachim commented> un-install then re-install = bad
Yes -- that will wipe your data!
> disable then add new files = bad
Yes, because a module needs to be active for its updates to run connectly!
Be sure to read the documentation on updating contrib modules!
Closing, as this is now resolved. Thanks for reporting back!
Comment #15
rfayFix title