diff --git a/core/modules/views/src/ViewExecutable.php b/core/modules/views/src/ViewExecutable.php index 0ca31da..8681212 100644 --- a/core/modules/views/src/ViewExecutable.php +++ b/core/modules/views/src/ViewExecutable.php @@ -23,7 +23,7 @@ * An object to contain all of the data to generate a view, plus the member * functions to build the view query, execute the query and render the output. */ -class ViewExecutable { +class ViewExecutable implements \Serializable { use DependencySerializationTrait; /** @@ -2201,4 +2201,21 @@ public function calculateDependencies() { return $this->storage->calculateDependencies(); } + /** + * {@inheritdoc} + */ + public function serialize() { + return serialize(array($this->storage->id(), $this->current_display)); + } + + /** + * {@inheritdoc} + */ + public function unserialize($serialized) { + list($storage_id, $current_display) = unserialize($serialized); + $this->storage = \Drupal::entityManager()->getStorage('view')->load($storage_id); + $this->setDisplay($current_display); + $this->initHandlers(); + } + }