Closed as not planned
Closed as not planned
Copy link
Description
Symfony version(s) affected
6.3.9, 6.4.0
Description
As of Symfony/var-exporter 6.3.9 I've got this error message on multiple places in my application:
Cannot access uninitialized non-nullable property App\Entity\User::$notifications by reference
It happens when I get an Organization from Doctrine.
My entity:
#[\ApiPlatform\Metadata\ApiResource(
// ...
)]
#[\Doctrine\ORM\Mapping\Entity(UserRepository::class)]
class User
{
#[ManyToOne(Organisation::class, cascade: ['persist'], inversedBy: 'users')]
#[Gedmo\Versioned]
private ?Organisation $organisation = null;
#[OneToMany('user', targetEntity: \App\Entity\User\Notification::class)]
private Collection $notifications;
public function __construct()
{
$this->notifications = new ArrayCollection();
}
}
How to reproduce
I'll create a reproducer if necessary, but before I do I'd like to hear some feedback. Maybe it's a simple mistake I've made, or someone has some suggestions how to create a reproducer.
Possible Solution
No response
Additional Context
No response