Skip to content
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

Infinite loop and order blocked with two specific cart rules #15574

Closed
jf-viguier opened this issue Sep 17, 2019 · 14 comments
Closed

Infinite loop and order blocked with two specific cart rules #15574

jf-viguier opened this issue Sep 17, 2019 · 14 comments

Comments

@jf-viguier
Copy link
Contributor

@jf-viguier jf-viguier commented Sep 17, 2019

Describe the bug
Infinite loop and order blocked with two specific cart rules.

To Reproduce
Steps to reproduce the behavior:
With a fresh Prestashop 1.7.6.1 installation in debug mode. Follow this exactly in this order :

  1. Go to BO/cart rules
  2. Add a first cart rule without voucher code with 10€ HT gift
  3. Add a product condition on "Home" Category and save
  4. Add another cart rule without voucher code with free delivery
  5. Go to front and add a product to the cart : You'll have 500 error on the ajax call
  6. Reload page : you'll get the infinite loop with this error "Maximum function nesting level of '256' reached, aborting!"
  7. Go to BO / Carts : I'll get the infinite loop too

If xdebug is enabled, You'll get the error "Maximum function nesting level of '256' reached, aborting!" If not, php will crash and you'll only have a 500 error.

This bug is not present in 1.6, It's a regression.

It seems that cart rules are recursively evaluated and product list is reconstructed each call of cart computation.

As already disscussed with @matks, this PR should fix the bug #12878

Screenshots
cartrule1
cartrule2

Additional information
PrestaShop version: 1.7.6.1
PHP version: 7.0

@khouloudbelguith

This comment has been minimized.

Copy link
Contributor

@khouloudbelguith khouloudbelguith commented Sep 17, 2019

Hi @jf-viguier,

I manage to reproduce the issue with PS1.7.6.1 & develop branch & PS1.7.6.0.
image
In the BO => Orders => Shopping cart page => Error 500
https://drive.google.com/file/d/1NF_01f5wjBDMQ4ko4XHn1VWuETOHuovH/view

With PS1.7.5.2 => OK

image
https://drive.google.com/file/d/1UsFAYsqj_KjZz-TFA7z6_5xCaTy-jkRw/view
I’ll add this to the debug roadmap.
Thanks!

@jf-viguier

This comment has been minimized.

Copy link
Contributor Author

@jf-viguier jf-viguier commented Sep 17, 2019

Thanks @khouloudbelguith
I can provide by email a real world dump with 300 cart rules for your future tests.

@ttoine

This comment has been minimized.

Copy link
Contributor

@ttoine ttoine commented Sep 17, 2019

you are speaking about PR #12878, is this issue related to #11172

@marionf marionf added this to Backlog in PrestaShop 1.7.6 via automation Sep 17, 2019
@colinegin colinegin moved this from Backlog to To be reviewed in PrestaShop 1.7.6 Sep 19, 2019
@colinegin colinegin moved this from To be reviewed to To do in PrestaShop 1.7.6 Sep 24, 2019
@marionf marionf removed the PR available label Sep 24, 2019
@colinegin

This comment has been minimized.

Copy link
Collaborator

@colinegin colinegin commented Sep 24, 2019

Unfortunately, after reviewing the PR, we have considered it does not fix the issue, so we put it back on the To do column and are going to work on it asap.

@jf-viguier

This comment has been minimized.

Copy link
Contributor Author

@jf-viguier jf-viguier commented Sep 24, 2019

Unfortunately, after reviewing the PR, we have considered it does not fix the issue, so we put it back on the To do column and are going to work on it asap.

ok @colinegin and what's the plan to fix it ?

@PierreRambaud PierreRambaud moved this from To do to In progress in PrestaShop 1.7.6 Sep 25, 2019
@PierreRambaud PierreRambaud self-assigned this Sep 25, 2019
@matks

This comment has been minimized.

Copy link
Contributor

@matks matks commented Sep 25, 2019

Unfortunately, after reviewing the PR, we have considered it does not fix the issue, so we put it back on the To do column and are going to work on it asap.

ok @colinegin and what's the plan to fix it ?

We go deeper in the code 😉
@PierreRambaud just assigned himself

@jf-viguier

This comment has been minimized.

Copy link
Contributor Author

@jf-viguier jf-viguier commented Sep 25, 2019

Thanks @PierreRambaud : you've got all my support.

@matks

This comment has been minimized.

Copy link
Contributor

@matks matks commented Sep 25, 2019

@PierreRambaud

This comment has been minimized.

Copy link
Contributor

@PierreRambaud PierreRambaud commented Sep 26, 2019

Hum, I tried many times with 1.7.5 and still have the problem. Seems not to be a regression.
image

@PierreRambaud

This comment has been minimized.

Copy link
Contributor

@PierreRambaud PierreRambaud commented Sep 26, 2019

We maybe found a fix with #15691 🤞

@PierreRambaud PierreRambaud moved this from In progress to To be reviewed in PrestaShop 1.7.6 Sep 26, 2019
@jf-viguier

This comment has been minimized.

Copy link
Contributor Author

@jf-viguier jf-viguier commented Oct 3, 2019

Hi all, have you validated the fix #15691 for this bug ?

@PierreRambaud

This comment has been minimized.

Copy link
Contributor

@PierreRambaud PierreRambaud commented Oct 7, 2019

@jf-viguier Still waiting for review and QA :/

@jf-viguier

This comment has been minimized.

Copy link
Contributor Author

@jf-viguier jf-viguier commented Oct 7, 2019

ok thanks

@Progi1984 Progi1984 added this to the 1.7.6.2 milestone Oct 8, 2019
@PierreRambaud PierreRambaud moved this from To be reviewed to In progress in PrestaShop 1.7.6 Oct 8, 2019
@matks matks removed the To Do label Oct 9, 2019
@matks matks moved this from In progress to To be reviewed in PrestaShop 1.7.6 Oct 9, 2019
@marionf marionf moved this from To be reviewed to To be tested in PrestaShop 1.7.6 Oct 9, 2019
@Robin-Fischer-PS Robin-Fischer-PS moved this from To be tested to To be merged in PrestaShop 1.7.6 Oct 10, 2019
@matks

This comment has been minimized.

Copy link
Contributor

@matks matks commented Oct 10, 2019

Fixed by #15691

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.