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

cart.items returned empty array [] but now returns blank #1404

Closed
jbruni opened this issue Dec 12, 2018 · 6 comments
Closed

cart.items returned empty array [] but now returns blank #1404

jbruni opened this issue Dec 12, 2018 · 6 comments

Comments

@jbruni
Copy link
Contributor

jbruni commented Dec 12, 2018

Expected behavior

In fact, previous behaviour.

Until this Monday (Dec 10, 2018), {{{json cart.items}}} returned [] (JSON notation for an empty array) when the cart was empty.

This is the expected behavior.

Actual behavior

Since yesterday, {{{json cart.items}}} returns a zero-length string, when the cart is empty.

This has broken several sites we develop, because they use a simple code snippet similar to this:

var cartItems = {{{json cart.items}}};

When it returned [], there was no error, because this became:

var cartItems = [];

Now, returning empty string, the snippet becomes:

var cartItems = ;

Which is a syntax error, breaking the code execution.

Steps to reproduce behavior

  • Use the Handlebars code snippet shared above.
  • Travel back in time, two days ago, before BigCommerce breaking change has been applied. Confirm the code works as expected.
  • Return to present time, and confirm the current backwards incompatible behavior.

We wonder if #1401 is an attempt to bring the already done breaking back-end change to the front-end...

Yep... we have several broken live production stores right now, due to this BigCommerce change.

@carsonreinke
Copy link
Contributor

Or related to #1402. I have case #03586811 in for this too.

@flair-duncan
Copy link
Contributor

@jbruni @carsonreinke We're also experiencing some issues with our themes because of this change, we used #1379 as a reference to fix our problems. May or may not be helpful in your case...

@jbruni
Copy link
Contributor Author

jbruni commented Dec 12, 2018

@flair-duncan @carsonreinke - Just opened #1405, which is also related.

@bookernath
Copy link
Contributor

Thanks @jbruni @carsonreinke @flair-duncan . The team is taking a look today.

@bookernath
Copy link
Contributor

This fix is deploying to our first deployment tier in production now. Our support team is able to upgrade any stores still affected. Assuming everything goes well in our rollout, all stores should get the fix within 24 hours. I'll post an update if that changes.

@jbruni
Copy link
Contributor Author

jbruni commented Dec 13, 2018

I'm closing the issue because BigCommerce fix deployment has reverted the problem in our stores. All is working fine again, just as before.

Thank you!

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

4 participants