Issue #2205367 by sun, Berdir: [HEAD BROKEN] PHP 5.4.
parent
f6e6e52871
commit
d1bbfa74e6
|
@ -25,7 +25,7 @@ use Drupal\entity\EntityDisplayBase;
|
||||||
* }
|
* }
|
||||||
* )
|
* )
|
||||||
*/
|
*/
|
||||||
class EntityFormDisplay extends EntityDisplayBase implements EntityFormDisplayInterface, \Serializable {
|
class EntityFormDisplay extends EntityDisplayBase implements EntityFormDisplayInterface {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
|
@ -148,20 +148,20 @@ class EntityFormDisplay extends EntityDisplayBase implements EntityFormDisplayIn
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function serialize() {
|
public function __sleep() {
|
||||||
// Only store the definition, not external objects or derived data.
|
// Only store the definition, not external objects or derived data.
|
||||||
$data = $this->getExportProperties() + array('entityType' => $this->getEntityTypeId());
|
$keys = array_keys($this->getExportProperties());
|
||||||
return serialize($data);
|
$keys[] = 'entityTypeId';
|
||||||
|
return $keys;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function unserialize($serialized) {
|
public function __wakeup() {
|
||||||
$data = unserialize($serialized);
|
// Run the values from getExportProperties() through __construct().
|
||||||
$entity_type = $data['entityType'];
|
$values = array_intersect_key($this->getExportProperties(), get_object_vars($this));
|
||||||
unset($data['entityType']);
|
$this->__construct($values, $this->entityTypeId);
|
||||||
$this->__construct($data, $entity_type);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue