Custom Module Popup Picker fails

Hello everyone,

I'm hoping someone has run into this issue and can help us get on the right track. I've got a custom module that is working great (Module A). I am trying to add a secondary custom module that is related to the first (Module B). It is very lightweight and is only going to be viewed from a report when selecting filters. Everything on the relationship side looks great, however, when trying to run a report from Module A that filters on Module A > Module B > name, I get a blank popup box where I am expecting a search and select popup. 

No errors are displayed in the SugarCRM logs, but I have found this php error: 

PHP Fatal error:  require_once(): Failed opening required 'modules/ModuleB/.php' (include_path='/var/www/html/900a:/var/www/html/900a/vendor:.:/usr/share/pear7:/usr/share/php7') in /var/www/html/900a/include/Popups/Popup_picker.php on line 42, referer: https://path_to_sugar/index.php?action=ReportCriteriaResults&module=Reports&page=report&id=sc-sample-report-contacts123456

Any advice or thoughts on what is needed to tell Sugar how to make the popup box work for search and select on this field? It's probably good to note also that there is a relate field setup on Module A that allows the user to search and select the correct Module B record which works just fine. 

Any help is appreciated. 

Thanks!

Jon

  • In case anyone comes across this, I was able to find that we needed a file inside of the custom module directory: /modules/ModuleB/metadata/popupdefs.php 

    Once that file is added, Sugar knows how to display the module for Search and Selects on Reports. Weird to me that it was not needed for the relate field, however. Either way, this is cleared up. 

    Here is our quick example for that popupdefs that got us working: 

    $module_name = 'ModuleB';
    $object_name = 'MODULEB';
    $popupMeta = array(
    'moduleMain' => $module_name,
    'varName' => $object_name,
    'searchInputs'=> array(
    0 => 'name',
    ),
    'searchdefs' => array (
    'name' => array (
    'name' => 'name',
    'width' => '100%',
    ),
    ),
    'listviewdefs' => array (
    'NAME' =>
    array (
    'width' => '100%',
    'label' => 'LBL_LIST_NAME',
    'link' => true,
    'default' => true,
    'name' => 'name',
    ),
    ),
    );