Inform-All Posted January 13, 2020 Share Posted January 13, 2020 (edited) I have a hook for one of my modules that worked just fine.. So my question is, how can i debug a not working hook? use Doctrine\DBAL\Query\QueryBuilder; use PrestaShop\PrestaShop\Core\Search\Filters\CustomerFilters; public function install($delete_params = true) { return parent::install() && $this->registerHook('actionCustomerGridQueryBuilderModifier'); } /** * @param array $params */ public function hookActionCustomerGridQueryBuilderModifier(array $params) { # My Code } If i check the customer list using debug modus, the hook 'actionCustomerGridQueryBuilderModifier' is never hooked from my module. But if i check 'Appearance > Positions' the hook is active! How can i debug? Or what am i missing here? Edited January 13, 2020 by Inform-All (see edit history) Link to comment Share on other sites More sharing options...
Inform-All Posted January 13, 2020 Author Share Posted January 13, 2020 4 minutes ago, ndiaga said: Hi, Try to reset your module and add it to that manually from the positions. Thank you for your answer! I've tried this already, did not have a difference, any other ideas? Link to comment Share on other sites More sharing options...
Inform-All Posted January 13, 2020 Author Share Posted January 13, 2020 (edited) the '$delete_params = true' was indeed not needed anymore, i've deleted it. And i've tested to return anything before (like you advised 'It works') but nothing, this hook is just not called. My debug mode does not even show it. Edited January 13, 2020 by Inform-All (see edit history) Link to comment Share on other sites More sharing options...
Inform-All Posted January 13, 2020 Author Share Posted January 13, 2020 It's the correct hook name according to the docs. I use it to filter out certain customers. Even if i look into the example docs it should be functioning. And it does function, but i just have one customer where is does not work that's why i'm wondering how can i debug this? Link to comment Share on other sites More sharing options...
Inform-All Posted January 13, 2020 Author Share Posted January 13, 2020 11 minutes ago, ndiaga said: If it works for other customers verify if the customer that it does not for meet the filter criterias. Thanks, what a rookie mistake! I fixed it. For people in the future, this might help: Make sure that if you are using 2 admin profiles, that BOTH profiles have access to the module to make the filter work that you install/use in a module. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now