Jump to content

[Solved]How to debug none working Hooks?


Recommended Posts

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 by Inform-All (see edit history)
Link to comment
Share on other sites

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...