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

Fix: Error on PDP when product is missing slug #751

Merged
merged 5 commits into from
Feb 9, 2021

Conversation

jrw421
Copy link
Contributor

@jrw421 jrw421 commented Feb 3, 2021

Resolves #750
Impact: minor
Type: bugfix

Issue

When a product was saved without a title and published to the storefront and the customer tries to open PDP for that product, the system throws 404 Not Found error (in case of Mac) and Sorry! We couldn't find what you're looking for error (in case of Ubuntu). Related to reactioncommerce/reaction-admin#304.

Solution

Only make the link to the PDP available if there is a slug present. If there is a slug, the product links to the product page as expected. Otherwise the product page does not link without a valid slug. If there's a more graceful way of avoiding this error I'm happy to chat through it!

Breaking changes

None expected.

Testing

  1. From reaction admin, create a product without its title (and thus, slug)
  2. Publish this product
  3. From storefront, click on the product without title
  4. The click should not link out to the product page or cause the page to error out.
  5. Click on a product with a valid slug.
  6. This should bring you to the PDP without issue.

Signed-off-by: jrw421 <jessica.wolvington@gmail.com>
Signed-off-by: jrw421 <jessica.wolvington@gmail.com>
Signed-off-by: jrw421 <jessica.wolvington@gmail.com>
Copy link
Contributor

@MohanNarayana MohanNarayana left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix works. Please change the commit message format.

Signed-off-by: jrw421 <jessica.wolvington@gmail.com>
@jrw421 jrw421 force-pushed the fix-304-jrw421-product-title branch from c56d1e6 to 53d5712 Compare February 5, 2021 15:59
Copy link
Contributor

@MohanNarayana MohanNarayana left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work

@jrw421 jrw421 merged commit 0ce36ff into trunk Feb 9, 2021
@jrw421 jrw421 deleted the fix-304-jrw421-product-title branch February 9, 2021 17:32
@MohanNarayana MohanNarayana mentioned this pull request Feb 9, 2021
@Akarshit Akarshit mentioned this pull request Mar 3, 2021
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.

Example-storefront: 404 on PDP when admin saves a product without title
2 participants