Calling Developers!
We are reenergizing our code contribution process! Learn More

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..

I think I found importer bug. Here is the scenario. In stores.php I have added 3 locales for $tem

Options
U035GSLDLVD
U035GSLDLVD Posts: 90 🧑🏻‍🚀 - Cadet

I think I found importer bug. Here is the scenario.

In stores.php I have added 3 locales for $templates and $stores variable: en_US, de_DE, en_GB . I am importing category data which is throwing following error:

Spryker\Zed\DataImport\Business\Exception\DataImportException - Exception: Unable to execute INSERT statement [INSERT INTO spy_url (id_url, fk_locale, fk_resource_categorynode, url) VALUES (:p0, :p1, :p2, :p3)]

To find out underlying issue, I kept only one record, root category demoshop in category.csv and category-store.csv file.

On debugging it, I found that when importer is trying to create category, it generates the urls from locale value's first key(bolded text) en_US, *de*_DE, *en*_US in spy_url table. as we have *en* for en_GB and en_US, it throws above error. If I change the first key of *en*_GB to *gb*_GB or *egb*_GB importer runs without any error (ofcourse data for en_GB won't get uploaded).

I believe someone might have seen this issue before. or is there any better way we can handle translation of it? Any help would be appreciated.

Comments

  • UP8T3GKFH
    UP8T3GKFH Posts: 56 🧑🏻‍🚀 - Cadet
    Options

    Hi @U035GSLDLVD, you got it right, it's the way Spryker generates URL. This also applies to products and I believe also to CMS pages. Since only the first part of the locale is used in the URL and every URL has to be unique - for a good reason - it doesn't work that way.
    If it only affects the URLs, you could include the whole locale in the URL (e.g. www.shop.com/en_gb/category1 etc.).
    Spryker should have known about this bug for a long time, because we already talked to them about it in our project more than a year ago.

  • U035GSLDLVD
    U035GSLDLVD Posts: 90 🧑🏻‍🚀 - Cadet
    Options

    @UP8T3GKFH Thanks for your reply. How did you overcome this issue? Where did you kept the full locale url?

  • UP8T3GKFH
    UP8T3GKFH Posts: 56 🧑🏻‍🚀 - Cadet
    Options

    We did not implement this in the project. We only pointed out to Spryker that this will lead to the problem.