Jump to content

Can't remove Change Password from module


robetus

Recommended Posts

I've created a provisioning module for v7.3.0 and I'm using the following to remove the Change Password button from the Module Command area in admin but it isn't working:

add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar)
{
    if(null !== $primarySidebar->getChild('Service Details Actions'))
    {
            $primarySidebar->getChild('Service Details Actions')
            ->removeChild('Change Password');
    }
});

Why isn't this working? It looks right to me.

Link to comment
Share on other sites

it would work as a pure hook, but remember...

https://developers.whmcs.com/hooks/module-hooks/

Quote

Hook files are only detected at the time a module is activated and configured. If you add your hook file after the module has already been activated, you may need to deactivate and reactivate your module in order for WHMCS to recognise it.

 

Link to comment
Share on other sites

When you say pure hook you mean inside /includes/hooks correct? It didn't work there either. Again no errors, just not working. I also place it inside the hooks.php file inside the module and it didn't work. This module is not an addon module so there is nothing to activate.

Link to comment
Share on other sites

4 hours ago, robetus said:

I'm using the following to remove the Change Password button from the Module Command area in admin but it isn't working:

ok, just noticed you're trying to use a client area hook in the admin area.. that's never going to work...

it might be useful to see a screenshot of what you're seeing and where this button is.

Link to comment
Share on other sites

  • 4 months later...
Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated