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
Fixed SQL apostrophe (') incompatibility #34441
Conversation
Lunyyx
commented
Nov 1, 2023
•
edited
edited
Questions | Answers |
---|---|
Branch? | 8.1.x |
Description? | Fixed the problem that was caused by apostrophes in SQL queries, this problem happened when the user write something like "Merci d'insérer votre personnalisation" as the apostrophe (') was considered as the end of the string. |
Type? | bug fix |
Category? | BO |
BC breaks? | no |
Deprecations? | no |
How to test? | Try to duplicate an item with a apostrophe (') in the customization field |
Fixed issue or discussion? | Fixes #34442 |
Hello @Lunyyx! This is your first pull request on the PrestaShop project. Thank you, and welcome to this Open Source community! |
Hi, thanks for this contribution! I found some issues with the Pull Request description:
Would you mind having a look at it? This will help us understand how interesting your contribution is, thank you very much! About linked issuesPlease consider opening an issue before submitting a Pull Request:
(Note: this is an automated message, but answering it will reach a real human) |
Fixed the old pull request |
Fixed the code according to the PHP CS Fixer
Co-authored-by: Daniel Hlaváček <daniel.hlavacek@hotmail.cz>
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.
I think it's OK. :-)
Some prepared statement or built in escape method would probably be better, but given the scope of that method and how it manually builds the query by joining the fields, it should work just fine. There should be no other possible fails that it could encounter, the rest of the query is not dynamic.
@M0rgan01 I think you ran the tests on develop instead of 8.1.x ;-) |
Perfect ! :) Yes, I think it's weird that there isn't any buildt in functions to do this, but anyway, it should work without any problem yes |
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.
Hello @Lunyyx ,
The field is not duplicated anymore. The process to checkout is working as expected.
It is QA ✅
Thanks!
@florine2623 I'm not sure I understand the message. :-) This issue was about an error when duplicating a product in BO. |
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.
Block to avoid accidental merge
Yes it is, maybe I didn't explained correctly, it's just about duplication of products in the BO as you said. |
why shouldn't the PR be merged @Hlavtox ? |
Hello @Hlavtox , The field was duplicated here in FO : And with the PR, the problem does not show up anymore ^^ For me it is OK to be merged |
@florine2623 OK, but the problem was in the backoffice, as you can see on video from @paulnoelcholot here - #34442 (comment) |
Hello again @Hlavtox and @Lunyyx , Indeed, well it seems that 2 problems are fixed then ! Although, now, I have a deprecation alert in FO whenever I duplicate a product. Whether there's an apostrophe or not : Could you check ? |
@florine2623 is it really because of this PR? did you check it on installation without it? |
We checked with florine privately and the issue is not related. So all good. :) Thanks everyone! |