diff -u b/core/lib/Drupal/Core/Entity/Entity.php b/core/lib/Drupal/Core/Entity/Entity.php --- b/core/lib/Drupal/Core/Entity/Entity.php +++ b/core/lib/Drupal/Core/Entity/Entity.php @@ -7,13 +7,14 @@ namespace Drupal\Core\Entity; +use Drupal\Core\DependencyInjection\DependencySerialization; use Drupal\Core\Language\Language; use Drupal\Core\Session\AccountInterface; /** * Defines a base entity class. */ -abstract class Entity implements EntityInterface { +abstract class Entity extends DependencySerialization implements EntityInterface { /** * The language code of the entity's default language. @@ -443,12 +444,2 @@ - /** - * {@inheritdoc} - */ - public function __sleep() { - // Don't serialize the url generator. - $this->urlGenerator = NULL; - - return array_keys(get_object_vars($this)); - } - }