Add explicit configuration in hooks for missing native modules - #904
Add explicit configuration in hooks for missing native modules#904jolelievre wants to merge 1 commit into
Conversation
Hlavtox
left a comment
There was a problem hiding this comment.
Same as classic PR, the hooks are not correct I think.
tblivet
left a comment
There was a problem hiding this comment.
Thanks @jolelievre 👍 these are my comments.
@Hlavtox, do you agree with this?
| - ~ | ||
| displayContactContent: | ||
| - contactform | ||
| - ps_contactinfo |
There was a problem hiding this comment.
ps_contactinfo This one should be removed.
There was a problem hiding this comment.
Yes, ps_contactinfo should not be here.
| - ps_customtext | ||
| - ps_featuredproducts | ||
| - ps_banner | ||
| - ps_customtext |
There was a problem hiding this comment.
ps_customtext Should stay just after the image slider.
| - ps_linklist | ||
| - ps_customeraccountlinks | ||
| - ps_contactinfo | ||
| - ps_socialfollow |
There was a problem hiding this comment.
ps_socialfollow This one should be removed.
| - productcomments | ||
| - ps_categoryproducts | ||
| - ps_crossselling | ||
| - ps_googleanalytics |
There was a problem hiding this comment.
ps_googleanalytics I think we don't need this one.
There was a problem hiding this comment.
Its used for tracking I think, but why do we need a non theme module configured here? I dont get it @jolelievre
| displayLeftColumn: | ||
| - ps_categorytree | ||
| - ps_facetedsearch | ||
| - ps_brandlist |
There was a problem hiding this comment.
ps_brandlist in my opinion, this should be moved to modules to disabled option.
| - ps_facetedsearch | ||
| - ps_brandlist | ||
| - ps_contactinfo | ||
| - ps_supplierlist |
There was a problem hiding this comment.
ps_supplierlist in my opinion, this should be moved to modules to disabled option.
| - ps_categorytree | ||
| - ps_facetedsearch | ||
| - ps_brandlist | ||
| - ps_contactinfo |
There was a problem hiding this comment.
ps_contactinfo This one should be removed.
There was a problem hiding this comment.
Yes, this should not be there.
| - ps_sharebuttons | ||
| - productcomments | ||
| - ps_emailalerts | ||
| - ps_viewedproduct |
There was a problem hiding this comment.
ps_viewedproduct This one should be removed.
There was a problem hiding this comment.
This is kinda borderline - the hook is required by this module to be there, it tracks the views there, check the code there.
But, does this entry belong to a theme configuration, if it's not visible? Maybe? Or not?
I don't really understand the logic of this whole config thing. Yes, a theme should look somehow when it's installed, but it's the module that says what hooks should be where. 🤔 We decide to change hooks in the next module version and we will adapt the theme YML? Hm hm hm.
There was a problem hiding this comment.
ps_viewedproduct is already hooked into displayFooterProduct, which is why I think it isn’t needed here. Moreover, this hook isn’t suitable for displaying a product list because it doesn’t take the full width.
There was a problem hiding this comment.
@tblivet It's there not to display, but to $this->addViewedProduct($this->currentProductId);.
| displayTop: | ||
| - ps_mainmenu | ||
| - ps_searchbar | ||
| - pagesnotfound |
There was a problem hiding this comment.
pagesnotfound I think we don't need this one.
|
@tblivet @Hlavtox can you give more details to why you want to remove some of the modules please? FYI I didn't add anything, I simply checked the native modules that register to the same hooks defined by the theme Which I didin't add anything, the added modules in this PR are purely a reflection of what was already happening when we installed all the native modules during a fresh install |
|
@jolelievre I get it, but the fact that module registers somewhere, doesn't make it a theme module. Theme YML should contain modules that NEED to be hooked so the theme works and functions properly. It should not mess up with statistics module, analytics modules etc., they have nothing to do with a theme. |
|
Hi @jolelievre and @Hlavtox, @jolelievre, if I’m right, for example, the So maybe we should take some time to update the config file to explicitly list all the modules that need to be hooked and remove the |
|
@tblivet |
|
@Hlavtox ok 👍 and what about |
|
@jolelievre @Hlavtox, without the ability to fine-tune things (for example via a
|
|
@tblivet This is an issue with the |
|
I propose closing this PR because I don't have time to argue for hours about this 😅 Wether you like it or not the modules will be hooked in these places during a fresh install anyway, but I agree with you that if they've been unhooked maybe it's not relevant to systematically rehook them when you switch to the theme (which is the only difference this PR brings). So let's keep the |
|
Regarding the |
|
@Hlavtox ok, but regarding the No problem @jolelievre i understand, sorry, but in fact, this is a real subject 👍 I think |
|
@jolelievre No worries Jo, everything is calm. It's just that originally good idea revealed million questions and nonsense we didn't know about. :-D |
|
@jolelievre as you mentioned before, I’ve closed the PR for now because it will need further discussion. |
|
@tblivet if you don't want to have |
|
@jolelievre I think the correct solution would be to remove this hooking on module install. :-) |
|
Why? if the module wants to hook there why would we remove it from the module just to please one theme? |
|
The module shouldn't want to hook there, it's some mistake introduced here - PrestaShop/ps_contactinfo#49. Another proof - https://github.com/PrestaShop/classic-theme/pull/52/files |
|
Oh! nice digging Let's drop it then 👍 |


~works as expected it's safer to update the configuration with actually expected hooks But we keep the~so this reference module doesn't mess with the shop configuration for tests~value, this modification only is useful when you switch from/to tier party themes