Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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. CreditAttribution: 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 CreditAttribution: torotil at more onion commenteddrush updb as well as update.php always update all installed modules. Not only the enabled ones.
Comment #4
torotil CreditAttribution: torotil at more onion commentedComment #6
Alan D. CreditAttribution: 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 CreditAttribution: torotil at more onion 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. CreditAttribution: Alan D. commentedA warning message is shown during the updates, which I personally think is enough if it doesn't break anything.