Sister issue to #2399965: Config entity get() and set() should invoke getters/setters.
There are currently three ways a property can be set in a config entity: setter (setDescription(), etc), set(), and the manual setting of the values in __construct().
__construct() does this by calling the parent constructor (Entity::__constructor()), which is something that ContentEntityBase doesn't do, for example.
So, easy fix, we stop calling the parent and set the values using set() instead.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | 2399999-1-use-set-in-configentity-constructor.patch | 720 bytes | bojanz |
Comments
Comment #1
bojanz commentedComment #3
larowlanConfig entities aren't magic like content ones, we can use regular property assignment instead of get and set methods
Comment #4
yched commentedTBH, I'm suprised that we have get() / set() on ConfigEntities...
Comment #5
bojanz commented@larowlan
The idea is to have only one way the system sets properties, to be able to intercept and validate the values more easily.
See #2399965: Config entity get() and set() should invoke getters/setters. I can live with this issue not going in, but it feels right so far.
@yched
Yeah, I'd prefer if we didn't, but that ship has sailed I think.
Comment #8
tim.plunkettI don't think this is out-of-scope for 8.0.x, but we need to prove why things can break if we don't do this.
Comment #19
larowlan#8 sounds like we need to demonstrate what this breaks
Comment #20
bojanz commentedWe'd have to ask 2014 me.
Comment #21
larowlan😂