Removing logic hook for specific module

Apologies if this has already been covered, but I cannot find anything that exactly matches this situation.

I want to remove the “mass assign” section from the Opportunities view. I can successfully do this by, as mentioned elsewhere, commenting out the following lines from custom/modules/logic_hooks.php :

$hook_array"'after_ui_footer"][] = Array(10, ‘popup_onload’, ‘modules/SecurityGroups/AssignGroups.php’,‘AssignGroups’, ‘popup_onload’);
$hook_array[“after_ui_frame”][] = Array(20, ‘mass_assign’, ‘modules/SecurityGroups/AssignGroups.php’,‘AssignGroups’, ‘mass_assign’);

but obviously that affects all modules; so I thought I could leave the aforementioned file as it is and add the following lines to custom/modules/Opportunities/logic_hooks.php :

$hook_array[“after_ui_footer”] = Array();
// $hook_array[“after_ui_footer”][] = Array(10, ‘popup_onload’, ‘modules/SecurityGroups/AssignGroups.php’,‘AssignGroups’, ‘popup_onload’);
$hook_array[“after_ui_frame”] = Array();
// $hook_array[“after_ui_frame”][] = Array(20, ‘mass_assign’, ‘modules/SecurityGroups/AssignGroups.php’,‘AssignGroups’, ‘mass_assign’);

but that has no effect - the “mass assign” section still appears in all the modules, including Opportunities.

If I do the opposite thing, i.e. comment the relevant lines out of custom/modules/logic_hooks.php, but ADD them to custom/modules/Opportunities/logic_hooks.php, then it does what I expect, i.e. the “mass assign” section is globally removed except for the specific Opportunities module.

So it appears that I can ADD a module-specific logic hook to the global ones, but cannot disable global ones for a specific module.

Any advice, please?

This isn’t a logic_hook issue, it’s a screen layout issue.

The first thing I would try is disabling “Mass Update” in Role management, for the appropriate role. This is probably the really appropriate way to do it - you don’t want certain users to have this ability.

If not, then somewhere in

you should be able to override whatever the parent classes are doing to show that screen… but I don’t know exactly how.

Thanks for that rapid response. To be honest, it was less the issue of that particular section appearing or not, that prompted me to start a topic, as much as the confusion over the hierarchy of logic hooks. A previous thread had specifically described using the “global” logic_hooks.php file to remove this section, so whether this was the best way to do it or not, it would still seem logical that you could override the logic hook at module level. I am less thinking about this example than a situation where I really do need a logic hook and I want a module-specific version to override, rather than just add to, the global version.

You need to check out Jim Mackin’s eBook “SuiteCRM for Developers”, that’s where you learn the grand scheme of things…