Problem/Motivation
1) Website notifies you of pending update, and to run update.php
2) Run update.php, receive the message; "Some of the pending updates cannot be applied because their dependencies were not met." with no useful details to debug the problem.
Conditions necessary to reproduce:
The only modules with pending updates need to all have incompatible schema versions. (For example, only one module requires an udpate, but it's schema version is incompatible).
There are a number of ways to reproduce it, but the easiest way would probably to do the following:
Pick a module that has implemented hook_update_last_removed(); (I originally encountered this problem via the mail_edit module)
https://api.drupal.org/api/drupal/modules%21system%21system.api.php/func...
Install an older version of that module, one that has a different database schema than the most recent (for instance if 7.11 is available, install 7.09).
Then connect to your database and change the schema_version value in the system table for that module to a value that will return false for hook_update_last_removed(); (like 3000 or something silly).
Then, attempt to update the module.
Programmatic Cause
In update.php at line 62 it checks each module to be updated and creates a form element. On line 64 it saves a form element, themed as a warning message, for each module update that is not compatible with it's existing schema version.
Then, at line 87 it increments a $count for only the modules with valid pending updates.
And finally, at line 111 if $count is zero, it will unset the form (and potentially hide the valid and important warning messages added at line 64).
Proposed resolution
Unsetting the form when there are no valid pending updates makes sense, and changing this logic would create other problems. I recommend instead of adding a warning-message-themed form element for the invalid updates we simply use drupal_message() to display the warning.
Remaining tasks
Patch needs to be reviewed.
User interface changes
When there are invalid (incompatible schema version) updates the warning will appear where drupal_messages are displayed instead of in a form element.
API changes
None.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | update-support-incompatible-2155779-1.patch.txt | 680 bytes | K.MacKenzie |
Comments
Comment #1
K.MacKenzie commentedpatch Added
Comment #2
K.MacKenzie commentedComment #3
mimes commentedI can't seem to reproduce this issue. I've tried installing modules with incompatible update schema versions, but it is not triggered. Could you provide a more detailed explanation of how to do so?
The patch itself appears as though it should work.
Comment #4
K.MacKenzie commentedThere are a number of ways to reproduce it, but the easiest way would probably to do the following:
Pick a module that has implemented hook_update_last_removed(); (I originally encountered this problem via the mail_edit module)
https://api.drupal.org/api/drupal/modules%21system%21system.api.php/func...
Install an older version of that module, one that has a different database schema than the most recent (for instance if 7.11 is available, install 7.09).
Then connect to your database and change the schema_version value in the system table for that module to a value that will return false for hook_update_last_removed(); (like 3000 or something silly).
Then, attempt to update the module.
Comment #5
K.MacKenzie commented