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

[6.x] Prevent passing the cart to the view #1013

Merged
merged 2 commits into from
Feb 13, 2024

Conversation

duncanmcclean
Copy link
Owner

This pull request prevents the cart variable from being passed from SC's controllers into the view.

Normally, when using entries, there's no issue with this. However, when using database orders and Runway v6, some of the raw augmented data contains query builders, which contain PDO objects which can't be serialized, leading to an error (#1003).

The easiest way to fix this is to just prevent the cart variable from being passed into the view. I can't find anywhere we're actually using the passed down cart variable in the docs or the starter kit and can't think of a case where you'd want it over using the {{ sc:cart }} tag.

We are still returning the cart data from the action controllers though but just for JSON responses where it doesn't seem to be an issue (probably because they get serialized differently).

Fixes #1003.

@duncanmcclean duncanmcclean merged commit 1dcbe73 into 6.x Feb 13, 2024
9 checks passed
@duncanmcclean duncanmcclean deleted the prevent-passing-cart-to-the-view branch February 13, 2024 23:08
Copy link

Released as part of v6.0.6.

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.

Serialization of 'PDO' is not allowed (On action routes to the CartItemController)
1 participant