Add Custom Module to Nav Bar

Hello,

I have a Custom Module that was created a long time ago with lots of data in it.  The Custom Module was created without checking the "Navigation Tab" in the Module Builder.  I would prefer not to try to re-build and re-deploy the Module in the Module Builder.  Is there a way to modify the Custom Directory so that this Custom Module will display in the Nav Bar?

Thank you,
Justin Kuehlthau

Parents
  • Justin,

    As Francesca said, redeploying is probably not the best idea as it can have consequences that you would have to investigate regarding other modifications and such.

    When your module (we'll call it "TestModule" here) was initially deployed, a file will have been created at: ./custom/Extension/application/Ext/Include/{package_name}.php and it is in here that you will need to make changes. If you created the module in ModuleBuilder without the Navigation Tab checked then that Include file will have created entries such as these:

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

    and you can probably see from here that the module has been added to the modInvisList[] array. It is also missing an entry in the $moduleList[] array. I believe all you need to do is adjust the contents of this file to remove the hide parts and add the show parts. So it looks like this (comments instead of delete for ease of demo):

    $beanList['test_TestModule'] = 'test_TestModule';
    $beanFiles['test_TestModule'] = 'modules/test_TestModule/test_TestModule.php';
    $moduleList[] = 'test_TestModule';
    //$modules_exempt_from_availability_check['test_TestModule'] = 'test_TestModule';
    //$report_include_modules['test_TestModule'] = 'test_TestModule';
    //$modInvisList[] = 'test_TestModule';

    A Quick Repair and Rebuild should then bring the module into the standard "Display Modules and Subpanels" section from where you can add it to the list of viewable modules.

    If you do this then you will need to be very careful not to redeploy the package as the config of the package would rebuild that extension file and make your module invisible again. If you want to avoid that at source then you can look for the config.php file in the package you created (at somewhere like: ./custom/modulebuilder/packages/{package_name}/modules/{module_name} ) and alter the 'has_tab' value. I think that should then pick up the visibility when you deploy again.

    If you want to trace all of this then you can look in: ./modules/ModuleBuilder/MB/MBModule.php (which is where the 'has_tab' is picked up and set as a 'tab' value) and: ./ModuleInstall/ModuleInstaller.php - which is where 'tab' is checked and if false it builds the extension file as I have shown above.

    Good luck Slight smile

    Thanks,

    JH.

Reply
  • Justin,

    As Francesca said, redeploying is probably not the best idea as it can have consequences that you would have to investigate regarding other modifications and such.

    When your module (we'll call it "TestModule" here) was initially deployed, a file will have been created at: ./custom/Extension/application/Ext/Include/{package_name}.php and it is in here that you will need to make changes. If you created the module in ModuleBuilder without the Navigation Tab checked then that Include file will have created entries such as these:

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

    and you can probably see from here that the module has been added to the modInvisList[] array. It is also missing an entry in the $moduleList[] array. I believe all you need to do is adjust the contents of this file to remove the hide parts and add the show parts. So it looks like this (comments instead of delete for ease of demo):

    $beanList['test_TestModule'] = 'test_TestModule';
    $beanFiles['test_TestModule'] = 'modules/test_TestModule/test_TestModule.php';
    $moduleList[] = 'test_TestModule';
    //$modules_exempt_from_availability_check['test_TestModule'] = 'test_TestModule';
    //$report_include_modules['test_TestModule'] = 'test_TestModule';
    //$modInvisList[] = 'test_TestModule';

    A Quick Repair and Rebuild should then bring the module into the standard "Display Modules and Subpanels" section from where you can add it to the list of viewable modules.

    If you do this then you will need to be very careful not to redeploy the package as the config of the package would rebuild that extension file and make your module invisible again. If you want to avoid that at source then you can look for the config.php file in the package you created (at somewhere like: ./custom/modulebuilder/packages/{package_name}/modules/{module_name} ) and alter the 'has_tab' value. I think that should then pick up the visibility when you deploy again.

    If you want to trace all of this then you can look in: ./modules/ModuleBuilder/MB/MBModule.php (which is where the 'has_tab' is picked up and set as a 'tab' value) and: ./ModuleInstall/ModuleInstaller.php - which is where 'tab' is checked and if false it builds the extension file as I have shown above.

    Good luck Slight smile

    Thanks,

    JH.

Children
No Data