Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove categories with unknown url_path from breadcrumbs #4488

Merged
merged 6 commits into from
Jun 18, 2020

Conversation

jissereitsma
Copy link
Contributor

In already 4 instances of Vue Storefront 1 with Magento 1, I've encountered the following issue: When categories are loaded into the breadcrumbs, they include the Magento Root Category (often with a name like Default Category). But because this Root Category serves a special purpose, the URL path is always empty. This fix simply checks whether the URL path is undefined and if so, it skips that category. Because the breadcrumbs are supposed to only contain categories with the URL path set.

In already 4 instances of Vue Storefront 1 with Magento 1, I've encountered the following issue: When categories are loaded into the breadcrumbs, they include the Magento Root Category (often with a name like **Default Category**). But because this Root Category serves a special purpose, the URL path is always empty. This fix simply checks whether the URL path is `undefined` and if so, it skips that category. Because the breadcrumbs are supposed to only contain categories with the URL path set.
@vercel
Copy link

vercel bot commented May 29, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/shopware-pwa/vue-storefront/8wgg8ub3m
✅ Preview: https://vue-storefront-git-fork-jissereitsma-patch-2.shopware-pwa.vercel.app

@vercel vercel bot temporarily deployed to preview May 29, 2020 16:57 Inactive
@gibkigonzo
Copy link
Contributor

Hey @jissereitsma wdyt about adding changes to formatCategoryLink instead
before:

return config.seo.useUrlDispatcher
  ? ('/' + storeCode + category.url_path)
  : ('/' + storeCode + 'c/' + category.slug)

after:

return config.seo.useUrlDispatcher && category.url_path
  ? ('/' + storeCode + category.url_path)
  : ('/' + storeCode + 'c/' + category.slug)

format /c/:slug is always valid even when we use url_path. If some category will be missing url_path then it will fallback to slug.

@gibkigonzo
Copy link
Contributor

Can you please rebase to branch hotfix/v1.12.1?

@vercel vercel bot temporarily deployed to preview June 16, 2020 17:42 Inactive
@jissereitsma jissereitsma changed the base branch from master to hotfix/v1.12.1 June 16, 2020 17:43
@vercel vercel bot temporarily deployed to preview June 16, 2020 17:43 Inactive
@jissereitsma
Copy link
Contributor Author

@gibkigonzo This should be done now.

@vercel vercel bot temporarily deployed to preview June 17, 2020 06:47 Inactive
@gibkigonzo gibkigonzo requested a review from pkarw June 17, 2020 08:21
@vercel vercel bot temporarily deployed to preview June 17, 2020 09:28 Inactive
@vercel vercel bot temporarily deployed to preview June 17, 2020 17:31 Inactive
@gibkigonzo gibkigonzo merged commit 2f6dce1 into vuestorefront:hotfix/v1.12.1 Jun 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants