This repository has been archived by the owner on Feb 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 219
initialize_session if it does not yet exist before calling the sessio… #5577
Merged
mikejolley
merged 1 commit into
trunk
from
fix/session-not-initialised-for-product-route
Jan 17, 2022
Merged
initialize_session if it does not yet exist before calling the sessio… #5577
mikejolley
merged 1 commit into
trunk
from
fix/session-not-initialised-for-product-route
Jan 17, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mikejolley
added
the
status: blocker
Used on issues or pulls that block work from being released.
label
Jan 17, 2022
rubikuserbot
requested review from
a team and
alexflorisca
and removed request for
a team
January 17, 2022 14:37
mikejolley
requested review from
nielslange
and removed request for
alexflorisca
January 17, 2022 14:37
mikejolley
added
focus: rest api
Work impacting REST api routes.
type: bug
The issue/PR concerns a confirmed bug.
labels
Jan 17, 2022
Size Change: 0 B Total Size: 818 kB ℹ️ View Unchanged
|
nielslange
approved these changes
Jan 17, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this quick fix, @mikejolley! Works as expected! 🚢
gigitux
pushed a commit
that referenced
this pull request
Jan 17, 2022
gigitux
added a commit
that referenced
this pull request
Jan 20, 2022
* Empty commit for release pull request * Update readme.txt with 6.8.0 changelog * initialize_session if it does not yet exist before calling the session class (#5577) * Add testing notes for 6.8.0 * update testing release notes * update testing notes * Fix default `stockStatusOptions` in tag and attribute blocks (#5590) * Fix default stockStatusOptions in tag and attribute blocks These should be an array of keys, not objects. * Fix stockStatus definition on PHP side * Swap state to debounce. * Improve presentation of stock filters * Remove state usage for display options * Remove debounce * Consistent panel titles * Fix global style for Product Summary block, Product Stock Indicator block, and Product Title block (#5595) * Fix global style for Product Summary block, Product Stock Indicator block, and ProductTitle block Fix global style for Product Summary block, Product Stock Indicator block, and ProductTitle block * add feature flag * fix lint errors * fix global style bugs on Product Title block * update testing release notes * update new build with fixes * Restore correct font style when the block is loaded in the editor (#5600) * Restore correct font style when the block is loaded in the editor Restore correct font style when the block is loaded in the editor * fix style on Twenty Twenty theme * update link for download the zip of the new release * update readme.txt * Bumping version strings to new version. Co-authored-by: github-actions <[email protected]> Co-authored-by: Luigi <[email protected]> Co-authored-by: Mike Jolley <[email protected]>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
focus: rest api
Work impacting REST api routes.
status: blocker
Used on issues or pulls that block work from being released.
type: bug
The issue/PR concerns a confirmed bug.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Bug introduced in #5406
cc @gigitux
The code that finds the quantity limits also looks up remaining stock. This relies on knowing if a draft order exists in session, and it's ID.
WooCommerce does not initalize the session on all routes. We do it manually on cart routes here: https://github.com/woocommerce/woocommerce-gutenberg-products-block/blob/trunk/src/StoreApi/Routes/AbstractCartRoute.php#L68 But product routes won't do this.
To fix, we just need to see if
session
exists, and if not, initialize it.We can skip the changelog entry if this ships before next release.
Testing
How to test the changes in this Pull Request:
Try this before and after to confirm you see the issue.