- last update
over 1 year ago 268 pass, 16 fail - 🇬🇧United Kingdom mcdruid 🇬🇧🇪🇺
Hmm, 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 workaround (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. - Status changed to Needs review
over 1 year ago 12:51pm 25 July 2023 - last update
over 1 year ago 278 pass - 🇬🇧United Kingdom mcdruid 🇬🇧🇪🇺
Here'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:
Database tables defined by
hook_schema()
will be removed automatically....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?
- Status changed to Postponed: needs info
over 1 year ago 1:20pm 25 July 2023