check for Guest validity in hookActionAuthentication#37
Open
mcaldex wants to merge 1 commit intoPrestaShop:devfrom
Open
check for Guest validity in hookActionAuthentication#37mcaldex wants to merge 1 commit intoPrestaShop:devfrom
mcaldex wants to merge 1 commit intoPrestaShop:devfrom
Conversation
Author
|
I've added some context for the issue I'm proposing to fix for this module. |
f50f13e to
ffef876
Compare
Author
|
ping @kpodemski @nicosomb , what do you guys think? |
kpodemski
reviewed
Oct 15, 2025
Contributor
kpodemski
left a comment
There was a problem hiding this comment.
Makes sense. I'm adding one suggestion to meet the coding requirements.
b0f7e21 to
04733a7
Compare
04733a7 to
faa9dc0
Compare
Author
|
done @kpodemski |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
$guest->mergeWithCustomer()function call, which if it's called with an empty Guest object, it will execute this query:Db::getInstance()->update('cart', ['id_guest' => (int) $idGuest,], 'id_guest = ' . (int) $this->id);where$this->idwill be equal to zero due to the fact that the same Guest object got deleted during the first login procedure by calling$guest->mergeWithCustomer(). That UPDATE query will set an id_guest for every cart in the database having id_guest = 0. Carts that have the id_guest set to 0 are temporary carts created from the Order creation page in the Backfofice. With this PR I'm proposing to check the validity of the Guest object before proceeeding to execute the hookActionAuthentication logic.