Closed GS-Wacan closed 3 years ago
Hi @GS-Wacan,
I think you forgot to call parent constructor in Challenge
and that's why translation collection didn't initialise. Let me know if this helps :)
Thank you for your quick answer ! It works perfectly now :).
I must have messed around with the properties when trying to figure out how it works and remove this line 👍
I just installed Locastic Translation Bundle in a new API Platform Symfony project. Everything works fine except POST requests, that return me an error.
I followed the detailed guide in the Readme and created my translatable entity, and setup the Locale.
I can translate existing content using PATCH requests, GET requests acknoledge my locale correctly and provide me translated informations in the right language with no error, so I think everything is setup correctly.
The error that POST requests return :
Return value of Locastic\\ApiPlatformTranslationBundle\\Model\\AbstractTranslatable::getTranslations() must implement interface Doctrine\\Common\\Collections\\Collection, null returned
Here's my entity ( Challenge.php )
And my translated entity ( ChallengeTranslation.php )
Is this a common issue ? A little help would be much appreciated as almost everything is working !