Postponed (maintainer needs more info)
Project:
Entity cache
Version:
7.x-1.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
25 Jul 2017 at 08:24 UTC
Updated:
25 Jul 2023 at 13:20 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
dineshw commentedTrying to drop existing tables in case hook_schema() gets executed again.
Better approach could be using hook_uninstall().
Comment #3
dineshw commentedUpdated Patch
Comment #4
dineshw commentedComment #6
gregglesA small code style nitpick:
There needs to be a space after the `if` and before the `(`.
Comment #7
gregglesReroll to fix that.
Comment #9
mcdruid commentedHmm, as mentioned in #2 I'm not certain we want to be dropping all the existing tables every time
hook_schema()is invoked.Manually testing this patch and installing, enabling and disabling entitycache I'm still hitting errors when
drupal_flush_all_caches()tries to flush tables that no longer exist.We can keep adding workarounds (e.g. check if the table exists before adding each bin in
entitycache_flush_caches()) but I think perhaps it'd be better to try a slightly different approach to solving the problem.That may be as simple as dropping the tables in
hook_uninstall(), but we'll want to check if that covers enabling/disabling too.Comment #10
mcdruid commentedHere's a patch that drops the tables in
hook_uninstall().However, this doesn't actually seem to be necessary AFAICS.
https://api.drupal.org/api/drupal/modules%21system%21system.api.php/func... says:
...and I've verified that works okay with some manual testing (using drush).
When the module is disabled, the tables are not removed (which I think is the correct behaviour).
I don't see any errors when the module is enabled again.
So I'm not actually able to reproduce there being any problem with letting the install/enable/disable/uninstall API work as it does now alongside the existing
hook_schema()implementation.Can anyone provide any steps to reproduce an error that requires a change in entitycache?
Comment #11
mcdruid commented