Hiding Modules from "Report Module" dropdown in Reports

I have been trying to find a solution for hiding unnecessary modules from being reportable in SuiteCRM 7.11.6:

Please let me know if I am heading in the right direction toward finding a solution for this, as it has been tripping me up for a few days now.

Check if this works for you:

https://suitecrm.com/suitecrm/forum/developer-help/24402-this-is-how-can-i-hide-modules

1 Like

In my case some modules need to be available on menus but just not on reports, would there be a way to modify your code to do so? Such as, is there an opposite to your $report_include_modules ? Thank you for the reply!

Also, I attempted your fix, but a quick repair/rebuild seemed to overwrite the modules.ext.php file in custom/application/Ext/Include; is that intended or does it sound like user error on my part with configuration?

I made it work using your code in /custom/Extension, but it breaks my environment every time, displaying this error (below my code) on a blank page for trying to hide any class:

$beanList['Contacts'] = 'Contacts';
$beanFiles['Contacts'] = 'modules/Contacts/Contact.php';
$modules_exempt_from_availability_check['Contacts'] = 'Contacts';
$report_include_modules['Contacts'] = 'Contacts';
$modInvisList[] = 'Contacts';

Fatal error: Uncaught Error: Class ‘Contacts’ not found in /var/www/html/suitecrm/include/MVC/SugarModule.php:113 Stack trace: #0 /var/www/html/suitecrm/modules/Users/User.php(2006): SugarModule->loadBean() #1 /var/www/html/suitecrm/modules/Users/User.php(2104): User->_getModulesForACL(‘admin’) #2 /var/www/html/suitecrm/modules/Users/User.php(2125): User->getAdminModules() #3 /var/www/html/suitecrm/modules/ACLActions/ACLAction.php(511): User->isAdminForModule(‘Accounts’) #4 /var/www/html/suitecrm/modules/ACL/ACLController.php(153): ACLAction::userHasAccess(‘99e630da-930f-8…’, ‘Accounts’, ‘edit’, ‘module’, true, false) #5 /var/www/html/suitecrm/modules/Accounts/Menu.php(55): ACLController::checkAccess(‘Accounts’, ‘edit’, true) #6 /var/www/html/suitecrm/include/MVC/View/SugarView.php(1392): require(’/var/www/html/s…’) #7 /var/www/html/suitecrm/include/MVC/View/SugarView.php(741): SugarView->getMenu(‘Accounts’) #8 /var/www/html/suitecrm/include/MVC/View/SugarView.php(218): SugarView->displayHeader() #9 /var/www/html/suit in /var/www/html/suitecrm/include/MVC/SugarModule.php on line 113

please advise if you know of a user error I am making

Follow these steps:

  1. Go to Admin >Display Modules and Subpanels and to hide both: the module and the subpanel for the required module.
  2. Create file custom\Extension\application\Ext\Include\Contacts.php and add the following code

$beanList['Contacts'] = 'Contacts';
$beanFiles['Contacts'] = 'modules/Contacts/Contact.php';
$modules_exempt_from_availability_check['Contacts'] = 'Contacts';
$report_include_modules['Contacts'] = 'Contacts';
$modInvisList[] = 'Contacts';
  1. Do a quick repair/rebuild

That should solve your issues.

Thanks.

1 Like

Thank you again for your reply, at this point I am just looking to hide the two default modules (Email Addresses and Users) from the Report Modules dropdown, but these are the only two that are not able to be disabled from Roles and do not show up in ‘Display Modules and Subpanels’. When I tried using your code in this way:

$beanList['EmailAddresses'] = 'EmailAddresses';
$beanFiles['EmailAddresses'] = 'modules/EmailAddresses/EmailAddress.php';
$modules_exempt_from_availability_check['EmailAddresses'] = 'EmailAddresses';
$report_include_modules['EmailAddresses'] = 'EmailAddresses';
$modInvisList[] = 'EmailAddresses';

I get the same as above error message. Any ideas on how to hide those two modules from reporting?

I have found how to hide those two modules (and really any others) from report modules, it is not upgrade safe but the fix is to make a separate dropdown list that is a duplicate of moduleList, except it has the undesired modules removed (in my case modulesListR), and to change modules/AOR_Reports/AOR_Report.php line 156 from

$app_list_strings['aor_moduleList'] = $app_list_strings['moduleList'];

to

$app_list_strings['aor_moduleList'] = $app_list_strings['moduleListR'];

now I am just trying to hide certain options from the module tree section, please let me know if you have any suggestions.