Locastic / ApiPlatformTranslationBundle

Translation bundle for ApiPlatform based on Sylius translation
MIT License
84 stars 27 forks source link

Error on loading AliceBundleFixtures #43

Closed rsereir closed 3 years ago

rsereir commented 3 years ago

I have an issue on loading AliceBundleFixtures for translations managed by ApiPlatformTranslationBundle.

This is the trace on loading fixtures:

In SimpleObjectGenerator.php line 111:

  An error occurred while generating the fixture "article_1_inventory2" (App\Entity\ArticleInventory): An error occurred while generating the fixture "article_color_blue_en" (App\Entity\ArticleColorT  
  ranslation): Call to a member function containsKey() on null                                                                                                                                           

In SimpleObjectGenerator.php line 111:

  An error occurred while generating the fixture "article_color_blue_en" (App\Entity\ArticleColorTranslation): Call to a member function containsKey() on null  

In TranslatableTrait.php line 146:

  Call to a member function containsKey() on null  

This is my fixtures:

App\Entity\ArticleColorTranslation:
    article_color_black_fr:
        translatable: '@article_color_black'
        locale: 'fr'
        name: 'Noir'
    article_color_black_en:
        translatable: '@article_color_black'
        locale: 'en'
        name: 'Black'
    article_color_white_fr:
        translatable: '@article_color_white'
        locale: 'fr'
        name: 'Blanc'
    article_color_white_en:
        translatable: '@article_color_white'
        locale: 'en'
        name: 'White'
    article_color_red_fr:
        translatable: '@article_color_red'
        locale: 'fr'
        name: 'Rouge'
    article_color_red_en:
        translatable: '@article_color_red'
        locale: 'en'
        name: 'Red'
    article_color_blue_fr:
        translatable: '@article_color_blue'
        locale: 'fr'
        name: 'Bleu'
    article_color_blue_en:
        translatable: '@article_color_blue'
        locale: 'en'
        name: 'Blue'
    article_color_yellow_fr:
        translatable: '@article_color_yellow'
        locale: 'fr'
        name: 'Jaune'
    article_color_yellow_en:
        translatable: '@article_color_yellow'
        locale: 'en'
        name: 'Yellow'
    article_color_green_fr:
        translatable: '@article_color_green'
        locale: 'fr'
        name: 'Vert'
    article_color_green_en:
        translatable: '@article_color_green'
        locale: 'en'
        name: 'Green'

Thanks for your help..

rsereir commented 3 years ago

I forgot in my __construct function of my translatable class :

parent::__construct();