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

Hook actionCartUpdateQuantityBefore replaced by obsolete hook actionBeforeCartUpdateQty #13518

Closed
psyray opened this issue Apr 22, 2019 · 4 comments
Labels
1.7.4.4 Affects versions 1.7.5.1 Affects versions BO Category: Back Office Bug Type: Bug Fixed Resolution: issue closed because fixed Minor Severity: minor bug > https://build.prestashop.com/news/severity-classification Positions Label: Which BO under menu is concerned

Comments

@psyray
Copy link
Contributor

psyray commented Apr 22, 2019

Describe the bug

During module installation with the new actionCartUpdateQuantityBefore hook, this one is replaced by the obsolete actionBeforeCartUpdateQty which was commented in the cart class.
So the new hook actionCartUpdateQuantityBefore is never called.

This is caused by 2 bad behaviours during the hook registering of the module install :

To Reproduce

Steps to reproduce the behavior:

  1. Install a module with the actionCartUpdateQuantityBefore hook position
  2. Hook position is replaced by actionBeforeCartUpdateQty during module installation

Fix

  • Delete the alias record in the hook_alias table
    image

OR

OR

Don't know what's the correct fix to use to provide a PR

Additionnal information
PrestaShop version: 1.7.5.0 fresh installed, not upgraded
PHP version: 7.1

@psyray psyray changed the title Hook actionCartUpdateQuantityBefore replace by obsolete hook actionBeforeCartUpdateQty Hook actionCartUpdateQuantityBefore replaced by obsolete hook actionBeforeCartUpdateQty Apr 22, 2019
@khouloudbelguith
Copy link
Contributor

Hi @psyray,

Thanks for your report.
I manage to reproduce the issue with PS1.7.5.1 & PS1.7.4.4.
In my module, I used the actionCartUpdateQuantityBefore hook.
mymodule.zip
In the BO => Design => Positions => the actionbeforecartupdateqty is used.
image
I’ll add this to the debug roadmap so that it’s fixed. If you have already fixed it on your end or if you think you can do it, please do send us a pull request!
Thanks!

@khouloudbelguith khouloudbelguith added 1.7.4.4 Affects versions 1.7.5.1 Affects versions BO Category: Back Office Bug Type: Bug Minor Severity: minor bug > https://build.prestashop.com/news/severity-classification Positions Label: Which BO under menu is concerned Ready Status: Issue is ready to be worked on labels Apr 23, 2019
@psyray
Copy link
Contributor Author

psyray commented Apr 23, 2019

I can't decide what's the good fix because I don't know your strategy about removing deprecated function.

For me the best fix is to remove the call to the getRetroHookName function at this line.
This could prevent another bug.

The more quickly is to uncomment this line.

You need to decide.

@eternoendless
Copy link
Member

I believe this one is fixed by this PR: #12578

@psyray
Copy link
Contributor Author

psyray commented Jun 4, 2019

@eternoendless
Yes it fixes the issue. Well done !
Thanks

@psyray psyray closed this as completed Jun 4, 2019
@khouloudbelguith khouloudbelguith added Fixed Resolution: issue closed because fixed and removed Ready Status: Issue is ready to be worked on labels Jun 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.7.4.4 Affects versions 1.7.5.1 Affects versions BO Category: Back Office Bug Type: Bug Fixed Resolution: issue closed because fixed Minor Severity: minor bug > https://build.prestashop.com/news/severity-classification Positions Label: Which BO under menu is concerned
Projects
None yet
Development

No branches or pull requests

3 participants