Prestashop: Hook actionCartUpdateQuantityBefore replaced by obsolete hook actionBeforeCartUpdateQty

Created on 22 Apr 2019  路  4Comments  路  Source: PrestaShop/PrestaShop

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

1.7.4.4 1.7.5.1 BO Bug Fixed Minor Positions

All 4 comments

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鈥檒l add this to the debug roadmap so that it鈥檚 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!

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.

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

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

Was this page helpful?
0 / 5 - 0 ratings