Closed (fixed)
Project:
Diff
Version:
7.x-3.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
23 Jan 2017 at 11:21 UTC
Updated:
9 Feb 2017 at 00:14 UTC
Jump to comment: Most recent
When the diff-module is disabled (but was enabled at some point diff_update_7307() fails with:
SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'module' cannot be null
. user_role_grant_permissions() Only works for permissions of enabled modules.
Comments
Comment #2
alan d. commentedSadly, that is Drupal, but why is that an issue?
If disabled, this update shouldn't be run and if it becomes enabled, the update should be outstanding still!? What did you use to run the updates when it was disabled?
FYI, the reason there is no disabled state in D8...
#1199946: Disabled modules are broken beyond repair so the "disable" functionality needs to be removed
Comment #3
torotil commenteddrush updb as well as update.php always update all installed modules. Not only the enabled ones.
Comment #4
torotil commentedComment #6
alan d. commentedYou are right, wonder what brain surgeon thought doing this was a good thing.
Give it a shot (latest tarball) or the quick hack for diff_update_7307() and I can roll a new release if you have no issues.
http://cgit.drupalcode.org/diff/diff/diff.install?id=ebbb81c
Comment #7
torotil commentedI don't think it's a good idea to fix it this way. If the module is re-enabled later the update is already run and therefore has no effect.
I think it would be better to fail (ie with a DrupalUpdateException()) and tell users to either uninstall or enable the module. Although consequences in this case aren't as severe, since the database is still in a consistent state.
Comment #8
alan d. commentedA warning message is shown during the updates, which I personally think is enough if it doesn't break anything.