Issue #2190421 by amateescu: Fix some services that shouldn't be serialized.

8.0.x
Alex Pott 2014-02-06 17:31:19 +00:00
parent f9c316f9fd
commit 5bcaf27b05
3 changed files with 21 additions and 0 deletions

View File

@ -338,6 +338,10 @@ abstract class ContentEntityBase extends Entity implements \IteratorAggregate, C
$this->fields = array();
$this->fieldDefinitions = NULL;
$this->clearTranslationCache();
// Don't serialize the url generator.
$this->urlGenerator = NULL;
return array_keys(get_object_vars($this));
}

View File

@ -394,4 +394,14 @@ abstract class Entity implements EntityInterface {
return $this->urlGenerator;
}
/**
* {@inheritdoc}
*/
public function __sleep() {
// Don't serialize the url generator.
$this->urlGenerator = NULL;
return array_keys(get_object_vars($this));
}
}

View File

@ -30,6 +30,13 @@ class CommentFormController extends ContentEntityFormController {
*/
protected $fieldInfo;
/**
* The current user.
*
* @var \Drupal\Core\Session\AccountInterface
*/
protected $currentUser;
/**
* {@inheritdoc}
*/