- Issue created by @GRcwolf
9.5.8
1.0.0-beta8
No domain related errors should occur after uninstalling the module.
I get the error The "domain" entity type does not exist. while running the cron.
The error is the same as described in
#2939640
🐛
The "domain" entity type does not exist.
Fixed
.
Have many entities with a "domain field" like domain_access.
Uninstall the module and run the cron.
The error occurs for the same reason as described in
#2939640
🐛
The "domain" entity type does not exist.
Fixed
.
The fix described there has the problem that it clears a max amount of field data during the uninstallation (50 in my case). If more data exists than what is specified in the batch size config, then it won't be cleared and the error occurs.
As a workaround, I changed the uninstall hook as follows:
function domain_uninstall() {
// Do a pass of purging on deleted Field API data, if any exists.
field_purge_batch(PHP_INT_MAX);
\Drupal::entityTypeManager()->clearCachedDefinitions();
}
This works, but is not a clean solution. It might also run into a timeout, depending on the amount of data and the PHP config.
Active
1.0
Code