Change record status: 
Project: 
Introduced in branch: 
8.4.x
Introduced in version: 
8.4.0
Description: 

Uninstalling a module that provides an alternative entity storage class was not possible because the module uninstall validation step had a hidden dependency on the hasData() method provided only by the default content entity storage class.

This has been fixed by moving the hasData() method up to the \Drupal\Core\Entity\EntityStorageInterface parent interface.

Actions required for module developers

No action is required for this change because the base \Drupal\Core\Entity\EntityStorageBase entity storage class provides a default implementation for the new method, which uses an entity query to find out if there is existing data for an entity type or not.

However, modules that provide alternative entity storage handlers are encouraged to override this method if they can provide an implementation that performs better than the default entity query. For example, the default config entity storage decides to check the config factory directly:

public function hasData() {
  return (bool) $this->configFactory->listAll($this->getPrefix());
}
Impacts: 
Module developers