-
-
Notifications
You must be signed in to change notification settings - Fork 164
Description
Sylius version affected: 1.13.0-ALPHA.3
Description
When removing a translation in combination with Symfony's property accessor component in a standard API platform PUT operation, crashes because of the Assert::notNull($translatable); check.
Steps to reproduce
Standard API platform configuration for a resource with a Put configuration and 'standard_put' => true, configured.
Define the resource as a Sylius resource with a translation.
Add the OneToMany with cascade options and orphanRemoval #[ORM\OneToMany(mappedBy: 'translatable', targetEntity: AreaTranslation::class, cascade: ['persist', 'remove'], orphanRemoval: true, indexBy: 'locale')]
Define the translation resource as an API platform resource.
Update a resource which has 2 translations, to remove one translation.
Api platforms PurgeHttpCacheListener checks if it can read the property translatable using symfony's property accessor.
When trying to return its value it throws the 500 due to the Assert::notNull($translatable)
Possible Solution
make the getter in the translationInterface nullable?
public function getTranslatable(): ?TranslatableInterface