Refactor hookActionCustomerAccountAdd in ps_emailsubscription#121
Open
Codencode wants to merge 2 commits intoPrestaShop:devfrom
Open
Refactor hookActionCustomerAccountAdd in ps_emailsubscription#121Codencode wants to merge 2 commits intoPrestaShop:devfrom
Codencode wants to merge 2 commits intoPrestaShop:devfrom
Conversation
Touxten
previously approved these changes
Jan 21, 2026
ps_emailsubscription.php
Outdated
| $this->sendVoucher($email, $code); | ||
| } | ||
|
|
||
| return (bool) Db::getInstance()->execute('DELETE FROM ' . _DB_PREFIX_ . 'emailsubscription WHERE id_shop=' . (int) $id_shop . ' AND email=\'' . pSQL($email) . "'"); |
Contributor
There was a problem hiding this comment.
Suggested change
| return (bool) Db::getInstance()->execute('DELETE FROM ' . _DB_PREFIX_ . 'emailsubscription WHERE id_shop=' . (int) $id_shop . ' AND email=\'' . pSQL($email) . "'"); | |
| return Db::getInstance()->execute('DELETE FROM `' . _DB_PREFIX_ . 'emailsubscription` WHERE id_shop = ' . (int) $id_shop . 'AND email = "' . pSQL($email) . '"'); |
Contributor
There was a problem hiding this comment.
Or only ' with slash ' ?
Contributor
Author
There was a problem hiding this comment.
@Touxten, I based it on the previous code, but if you think it's better this way, I'll make the change.
Contributor
There was a problem hiding this comment.
Yes, I saw that. What's causing me trouble is the mix of ' / ” at the end of the query.
I've validated the PR. I'll leave it up to you to choose :D Nice job !
Contributor
Author
There was a problem hiding this comment.
@Touxten I made the change you suggested, it does look better stylistically :-)
Thanks!
Touxten
approved these changes
Jan 21, 2026
Contributor
|
I'm going to do a PR to correct the tests. |
Contributor
3756e51 to
b4ba7f6
Compare
Contributor
Author
|
@Touxten your PR worked perfectly! Thanks! |
Contributor
Author
|
ping @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.
hookActionCustomerAccountAddlogic by acting only on valid emails and newsletter-subscribed customers, removing unnecessary and unreachable code.Related: #114 (comment)