diff --git a/core/modules/views/src/ViewExecutable.php b/core/modules/views/src/ViewExecutable.php index 3d38a98..c1aa7cf 100644 --- a/core/modules/views/src/ViewExecutable.php +++ b/core/modules/views/src/ViewExecutable.php @@ -2289,15 +2289,9 @@ public function calculateDependencies() { * {@inheritdoc} */ public function serialize() { - if ($this->storage instanceof ViewUI) { - $storage = $this->storage; - } - else { - $storage = $this->storage->id(); - } - return serialize([ - $storage, + // Only serialize the storage entity ID. + $this->storage->id(), $this->current_display, $this->args, $this->current_page, @@ -2318,7 +2312,7 @@ public function unserialize($serialized) { $this->setRequest(\Drupal::request()); $this->user = \Drupal::currentUser(); - $this->storage = is_object($storage) ? $storage : \Drupal::entityManager()->getStorage('view')->load($storage); + $this->storage = \Drupal::entityManager()->getStorage('view')->load($storage); $this->setDisplay($current_display); $this->setArguments($args); diff --git a/core/modules/views_ui/src/ViewUI.php b/core/modules/views_ui/src/ViewUI.php index 6a41d9b..6f954ec 100644 --- a/core/modules/views_ui/src/ViewUI.php +++ b/core/modules/views_ui/src/ViewUI.php @@ -1285,6 +1285,9 @@ public function getThirdPartyProviders() { return $this->storage->getThirdPartyProviders(); } + /** + * {@inheritdoc} + */ public function __sleep() { $vars = get_object_vars($this); unset($vars['executable']);