What are the Slack Archives?

It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.

Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..

Hi there πŸ™‚ I have a question concerning data import - scenario is two stores,

USPATDHK5
USPATDHK5 Posts: 60 πŸ§‘πŸ»β€πŸš€ - Cadet
edited May 2020 in Help

Hi there πŸ™‚
I have a question concerning data import - scenario is two stores, A and B, same Codebase. StoreA has DE and EN, StoreB has only EN - and now the problem kicks in. I have to separate the data, as StoreB das not understand the locale DE.
I solved the problem by renaming the csv files and attaching the storeName dynamically with Store::getInstance()->getStoreName()

How do I cope with the tests? There are hardcoded strings that point e.g. to company_user.csv - If i rename the csv to company_user_DE.csv e.g. the test won’t work anymore.
Thanks πŸ¦„

Comments

  • Jeremy Fourna
    Jeremy Fourna Lead Product Manager Posts: 130 πŸ§‘πŸ»β€πŸš€ - Cadet

    Hello @USPATDHK5, you do not need to separate the data, if some stores does not support the same language, it does not mean that the underlying entities such products, discount, cms pages cannot support them.

    A store with EN and DE as languages only means that this store when viewed via a web browser can display content in EN and DE thats all.

    You can still have products for example translated in FR, ES, IT, DE and EN

    Is your problem only related to company user?

  • USPATDHK5
    USPATDHK5 Posts: 60 πŸ§‘πŸ»β€πŸš€ - Cadet
    edited May 2020

    As soon as you have translatable content, e.g. meta_description and one of the stores does not support the language the import won’t work -> an exception is thrown πŸ™‚ (it also does in the demo shop, if the US Store does not support the locale 'de' => 'de_DE' anymore:
    Spryker\Zed\DataImport\Business\Exception\DataImportException - Exception: Could not extract language identifier for idLocale β€œ46”
    idLocale β€œ46" is german πŸ™‚

    no no the problem is in multiple (test)files, as the tests contain the links to the csv files hard coded as a string.

  • Jeremy Fourna
    Jeremy Fourna Lead Product Manager Posts: 130 πŸ§‘πŸ»β€πŸš€ - Cadet

    OK then it seems to be a bug. @valerii.trots where is the support portal that can allow @USPATDHK5 to create a ticket there?

  • Valerii Trots
    Valerii Trots SRE @ Spryker Sprykee Posts: 1,654 ✨ - Novice
  • USPATDHK5
    USPATDHK5 Posts: 60 πŸ§‘πŸ»β€πŸš€ - Cadet
    edited May 2020

    I’m not sure whether I agree that it is a bug πŸ˜„

    in the demoshop US does support de_DE, if you withdraw that support and then try to import explicit data for de_DE, it’s actually a logic consequence that it does not work anymore - or am I mistaken?

  • Jeremy Fourna
    Jeremy Fourna Lead Product Manager Posts: 130 πŸ§‘πŸ»β€πŸš€ - Cadet
    edited May 2020

    Importing data for a given locale should not trow an exception if a store does not support it

  • Jeremy Fourna
    Jeremy Fourna Lead Product Manager Posts: 130 πŸ§‘πŸ»β€πŸš€ - Cadet

    this is why it is a bug for me

  • USPATDHK5
    USPATDHK5 Posts: 60 πŸ§‘πŸ»β€πŸš€ - Cadet

    with given locale you mean spryker supports in general?

  • USPATDHK5
    USPATDHK5 Posts: 60 πŸ§‘πŸ»β€πŸš€ - Cadet

    Thank you! I created a ticket

  • Jeremy Fourna
    Jeremy Fourna Lead Product Manager Posts: 130 πŸ§‘πŸ»β€πŸš€ - Cadet

    Spryker should support any locale that those are linked to a store or not does not matter

  • UQ958DA4U
    UQ958DA4U Posts: 232 πŸ§‘πŸ»β€πŸš€ - Cadet

    Good to know! I thought the exception was intentional.

  • Valerii Trots
    Valerii Trots SRE @ Spryker Sprykee Posts: 1,654 ✨ - Novice
    edited May 2020

    Hi @USPATDHK5, sorry for the late reply, but finally I was able to check the issue using latest spryker-shop/suite.
    What I did:
    1. Modified config/Shared/stores.php to have only en_US locale for US store.
    2. Installed application from the scratch for sake of experiment.
    3. Ran import like APPLICATION_STORE=US docker/sdk console data:import category in docker.

    My actual result is:

  • USPATDHK5
    USPATDHK5 Posts: 60 πŸ§‘πŸ»β€πŸš€ - Cadet

    I tried it on two different checkouts and it did not work - to make sure I tried it with a clean checkout just now, and it went through - totally unpredictable - Do you think it has to do with docker sync?

  • Valerii Trots
    Valerii Trots SRE @ Spryker Sprykee Posts: 1,654 ✨ - Novice

    I will try later once again using spryker-shop/b2c-demo-shop or spryker-shop/b2b-demo-shop.

  • Valerii Trots
    Valerii Trots SRE @ Spryker Sprykee Posts: 1,654 ✨ - Novice

    In latest spryker-shop/b2c-demo-shop the result is the same - can't reproduce the problem.
    I'm not sure if it's env-specific.
    But in case it is, I'm using docker in linux so no docker-sync.