Open mpoiriert opened 7 months ago
Any solution to this problem?
I have solved this using fetch EAGER in my entity relation:
#[ORM\ManyToOne(fetch: 'EAGER', targetEntity: Gender::class, inversedBy: 'staffs')]
#[ORM\JoinColumn(name: 'gender', referencedColumnName: 'id')]
private $gender;
See #767 for a fix.
The default and current local of a translation is done via the "postLoad".
When have a proxy object the post load event is only triggered if we access a property that is not in the list of "$skippedProperties"
Accessing any property that are not in the orm (and id) will not trigger the post load event.
so this code:
Will always return 'en' on the first call if "translate" is the first method call (proxy will not get initialize).
Which is the wrong behavior.
I have not idea how to fix this properly since it's doctrine proxy factory that decide which proper to that should be skipped.