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

Can't visit other products after visiting a product without "product page title" #1295

Closed
riyadhzen opened this issue Aug 15, 2016 · 1 comment

Comments

@riyadhzen
Copy link

riyadhzen commented Aug 15, 2016

Expected behavior

Supposed to be able to visit other products after visiting a product that doesn't have Product page title field.

Actual Behavior

Can't visit other products after visiting a product created without "product page title" field.

I get the following error in the console: ""Uncaught TypeError: Cannot read property 'substring' of undefined""

Steps to Reproduce the Behavior

To reproduce this behaviour, create some products by filling all their fields, then create another product without specifying "Product page title" field. Go back to the main page where you can see all the products, visit the product that doesn't have the "Product page title" field, go back to the main page again, then try to visit other products (You will not be able to do so).

The problem can be found in /reaction/lib/api/router/metadata.js line: 79.
In this line you have assigned product.pageTitle.substring(0, 160) to content field, and this is found in an if block where we check for ""product && product.description"".

I suggest changing product.pageTitle.substring(0, 160) to product.description.substring(0, 160) in line: 79

I would love to work on that.

@brent-hoover
Copy link
Collaborator

@riyadhzen Sorry this didn't get noticed before. Next time you can just submit a PR directly and we will get your fix in. Thanks for taking the time to look closely at the error.

This was fixed via: #1606

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

No branches or pull requests

2 participants