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

Add DB prefix in delete() method all time $add_prefix is set to true #8328

Merged
merged 1 commit into from Sep 18, 2017

Conversation

Projects
None yet
3 participants
@prestamodule
Contributor

prestamodule commented Sep 14, 2017

Questions Answers
Branch? develop
Description? While you set up your shop with the DB prefix as "pr", you will have some errors occuring while using the delete() method of Db class cause this one will try to include the prefix only and only if this one do not start the name of the table. Eg: pr is the beginning of products, so while you try a delete() on products table, it will be an error (the prefix will not be included).
Type? bug fix
Category? CO
BC breaks? no
Deprecations? no
How to test? Install a shop with "pr" DB prefix and made a delete() on table "products" with/without this change.

Eg: Set the shop with a DB prefix as this one: cu
Try to make this call: Db::getInstance()->delete('customer_group', 'id_customer = 1', 1);
The delete() method will start like that: DELETE FROM customer_group

Now, set the show with a Db Prefix as this one: cu_
The same call and you will have that: DELETE FROM cu_customer_group

@Quetzacoalt91 Quetzacoalt91 added this to the 1.7.3.0 milestone Sep 18, 2017

@Quetzacoalt91 Quetzacoalt91 merged commit aa5633f into PrestaShop:develop Sep 18, 2017

2 checks passed

codacy/pr Good work! A positive pull request.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@Quetzacoalt91

This comment has been minimized.

Show comment
Hide comment
@Quetzacoalt91
Member

Quetzacoalt91 commented Sep 18, 2017

Thank you @prestamodule

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment