Prestashop: weird behavior when displayHeader is used in theme.yml

Created on 29 Nov 2019  路  6Comments  路  Source: PrestaShop/PrestaShop

Describe the bug
displayHeader usage in theme.yml causes a weird behavior : a new hook is created et launched before the header hook (the good one)

To Reproduce
Steps to reproduce the behavior:

  1. add a displayHeader section in yout theme.yml with a module
  2. Reinit the theme
  3. Go to ps_hook and see displayHeader hook, the module should be hooked to the real header hook.
    In fact the module is hooked twice : in displayHeader and header hook.

displayHeader is an alias of header hook (ps_hook_alias). To follow 1.7 conventions this should be the other way around.

Additional information
PrestaShop version: 1.7.6.1
PHP version: 7.0

1.7.5.2 1.7.6.1 1.7.6.2 Bug CO Minor Modules & Themes Positions To Do

All 6 comments

Hi @jf-viguier,

Is it the same issue reported in this ticket: https://github.com/PrestaShop/PrestaShop/issues/10405?

Thanks!

@khouloudbelguith no

@jf-viguier, I did not manage to reproduce the issue with PS1.7.6.2 using this theme
childtheme-example.zip
image

Thanks to check & feedback.

You can see the bug in your screenshot : the hook is displayHeader and should be just header

@jf-viguier, thanks for these clarifications.
I manage to reproduce the issue with PS1.7.6.2 & PS1.7.5.2.
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!

In fact, the official hook name should be displayHeader and header the alias, but I don't know the impact to rename a hook.
This should fix #10405

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Prestaworks picture Prestaworks  路  3Comments

zuk3975 picture zuk3975  路  3Comments

Van-peterson picture Van-peterson  路  3Comments

vincent-dp picture vincent-dp  路  3Comments

centoasa picture centoasa  路  3Comments