Health Check Error: Vardef HTML function in module for field


    The Health Check wizard must be run when upgrading in order to evaluate your instance’s ability to move to the target version. During the health check, various types of issues may be detected which can affect your ability to upgrade. This article will cover the “Vardef HTML function in module for field” error reported by the health check.


    This error generates an output similar to the following in health check:


    This error may accompany the “Vardef HTML function” error in the health check. For more information regarding the “Vardef HTML function” error, please refer to the article¬†Health Check Error: Vardef HTML function.

    The “Vardef HTML function in module for field” error is caused when a custom module has a function defined in the ./modules/{custom_module_name}/vardefs.php file or ./custom/Extension/modules/{custom_module_name}/Ext/Vardefs/{custom_file_name}.php file. The vardef file contains an array such as the following:

    'contacts_fields' =>   
     array (    
      'function' =>     
       array (       
        'name' => 'getObjectFields',       
        'returns' => 'html',      
        'include' => 


    To address this error, Sugar creates a file under ./custom/Extension/application/Ext/Include/upgrade_bwc.php when upgrading to the target version. It then adds the following line with the module’s name in which these vardefs are found, to enable this module for Legacy mode:

    $bwcModules[] = 'EX_Example';

    Note: This file should never be manually modified to remove a module out of Legacy mode.  

    The specified module in the error will not be upgraded to the Sidecar user interface and will continue to be available with the Legacy user interface upon upgrade. It is recommended that the module be tested after upgrade to ensure that it continues to work as expected.  

    in Troubleshooting Health Check Output

    Reach out to us for help