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.
To summarize: during major version upgrades, if a module introduces a new table, it's not created until the update is run; but the standard way to upgrade modules is to first re-enable the module, then run updates. Because module enablement calls a cache clear, it attempts to clear a non-existent table and dies in a very ugly way.
This is effectively a duplicate of a core bug #1477932: Allow cache() and cache_clear_all() to fail gracefully if a database cache bin does not exist, but it might be nice to implement a stopgap in the meantime.
Patch attached.
Comment | File | Size | Author |
---|---|---|---|
#5 | libraries-major_version_upgrade_cache-1578618-5.patch | 473 bytes | iamEAP |
#2 | libraries-major_version_upgrade_cache-1578618-2.patch | 514 bytes | iamEAP |
libraries-major_version_upgrade_cache-0-0.patch | 353 bytes | iamEAP | |
Comments
Comment #1
tstoecklerWe should definitely include a comment referencing the core issue.
Otherwise this looks good.
Comment #2
iamEAP CreditAttribution: iamEAP commentedWith comments.
Comment #3
tstoecklerI tried writing upgrade tests for this, but that didn't work. At least I couldn't get them to fail with the status quo. Apparently SimpleTest additionally clears some caches at the right place, which update.php doesn't.
I'll try to commit this in the next few days. I think the comment can be shortened. Simply
should be fine.
Comment #4
sunShorten, yes. But at minimum a concrete and concise hint/summary for why a strange workaround is needed. That hint should be concise for the actual workaround, not a summary for the more generic problem space.
E.g.:
Thus, in the not so unlikely case that this core bug still exists when Libraries API goes 3.x (or alternatively, when no one uses 1.x anymore), then this kind of comment sufficiently clarifies that the workaround can be safely removed, even though the generic Drupal core bug still exists.
Comment #5
iamEAP CreditAttribution: iamEAP commentedMore concise summary in comment.
Comment #6
sunYou obviously wanted to replace that with a real URL...
Anyway, took the comment from #4 and fixed the issue URL, and committed to 7.x-2.x.
Comment #7
iamEAP CreditAttribution: iamEAP commentedHeh. Whoops. Thanks, sun.