Change when item existence is checked in order to update / add new item, see #9445 #9553
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.
Description
This commit corrects a validation within a quote save method. Because this function checks whether
getItemById($itemId)
returns an item too late (while already being in the update part) the exception messageCart %1 does not contain item %2
is shown. By doing this validation one line earlier, it can continue in the else part if this item is not known to the quote. In the else part, a new product is added to the cart as it should.It's not easy to reproduce. In order to reproduce and verify this, i've setup a small module in a repository that can be used. The README file contains more in-depth explanation.
https://github.com/frosit/module-devpoc.git
Fixed Issues (if relevant)
Manual testing scenarios
Contribution checklist