Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
entity system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
25 Jan 2015 at 15:16 UTC
Updated:
26 Feb 2015 at 12:54 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
yched commentedLet's see what breaks.
Comment #3
yched commentedOK, yeah, we cannot pass the whole set of $this properties into the __construct(), because that would cause $this->pluginManager to stay to its default value of NULL.
We really need to pass only the values from toArray() into the __construct(), but we need to know which those are without running toArray() again.
This should do the trick.
Ugly because of the way __sleep() / __wakeup() works, we should really try get back to Serializable :-/
Also, #2405165: Entity::setOriginalId() does enforceIsNew(FALSE), that is wrong for ConfigEntities would help making __wakeup() a bit clearer by removing the isNew() / enforceIsNew() dance.
Comment #4
amateescu commentedIndeed, the new code is quite ugly but since we don't have any better way to do it now, I think the performance of not involving the schema in these operations is worth it.
As far as I remember, the problem was some difference between 5.3 and 5.4, but now that we require PHP 5.4, I think it should be possible?
Comment #5
catchOK it is indeed not pretty, but I don't have a better idea and it's self-contained until we can sort out Serializable. Committed/pushed to 8.0.x, thanks!