diff -u b/core/lib/Drupal/Core/Entity/EntityDefinitionUpdateManager.php b/core/lib/Drupal/Core/Entity/EntityDefinitionUpdateManager.php --- b/core/lib/Drupal/Core/Entity/EntityDefinitionUpdateManager.php +++ b/core/lib/Drupal/Core/Entity/EntityDefinitionUpdateManager.php @@ -130,7 +130,7 @@ break; case static::DEFINITION_DELETED: - $this->entityManager->onFieldStorageDefinitionDelete($storage_definitions[$field_name]); + $this->entityManager->onFieldStorageDefinitionDelete($original_storage_definitions[$field_name]); break; } } diff -u b/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php b/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php --- b/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php +++ b/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php @@ -1673,6 +1673,13 @@ } else { $data_table = $this->dataTable ?: $this->baseTable; + // @todo This check is here because system_system_info_alter() calls + // countFieldData(), even in KernelTestBase tests, where the schema + // might not have been created. Remove this when that function is + // refactored. See that function for its issue links. + if (!$this->database->schema()->tableExists($data_table)) { + return $as_bool ? FALSE : 0; + } $query = $this->database->select($data_table, 't'); $columns = $storage_definition->getColumns(); if (count($columns) > 1) { diff -u b/core/modules/system/system.module b/core/modules/system/system.module --- b/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -8,7 +8,6 @@ use Drupal\Component\Plugin\Exception\PluginNotFoundException; use Drupal\Core\Block\BlockPluginInterface; use Drupal\Core\Cache\Cache; -use Drupal\Core\Entity\ContentEntityTypeInterface; use Drupal\Core\Extension\Extension; use Drupal\Core\Extension\ExtensionDiscovery; use Drupal\Core\Form\FormStateInterface; @@ -1051,7 +1050,7 @@ try { // We skip entity-defining modules, otherwise deleting all entities // would be required before being able to uninstall them. - if ($entity_type instanceof ContentEntityTypeInterface && $entity_type->getProvider() != $module_name) { + if ($entity_type->isFieldable() && $entity_type->getProvider() != $module_name) { $storage_definitions = $entity_manager->getFieldStorageDefinitions($entity_type_id); // @todo Make it easier to query if there are entities: // https://www.drupal.org/node/2337753.