Let the platform do the work

Health Check Error: Bad vardefs - module has invalid vardefs for field

Overview

The Health Check wizard must be run when upgrading 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 how to resolve a "Bad vardefs - module has invalid vardefs for field" error reported by the health check.

Symptoms

This error generates an output similar to the following in health check: "Bad vardefs - module has invalid vardefs for field".

Resolution

The generated error message will help determine the contents of the file causing the health check error. It will contain an invalid "link_file" vardef attribute.

The vardef attribute "link_file" has been deprecated. From now on, you will have to use the "link_class" attribute. The class specified for "link_class" should be autoloadable by composer or SugarAutoLoader. When you create a new link_class value, do not forget to update the autoload class map: composer dump-autoload

Composer generates an autoload class map following the rules declared in composer.json as follows:

  "psr-4":{
   "Sugarcrm\\Sugarcrm\\":[
      "src/",
      ""
   ],
   "Sugarcrm\\Sugarcrm\\custom\\":[
      "custom/src/",
      "custom/"
   ],
   "Sugarcrm\\Sugarcrm\\inc\\":"include/",
   "Sugarcrm\\Sugarcrm\\custom\\inc\\":"custom/include/"
},
"classmap":[
   "api/",
   "clients/",
   "custom/",
   "data/",
   "include/",
   "install/",
   "jssource/",
   "modules/",
   "ModuleInstall/",
   "service/",
   "soap/",
   "src/Dbal/Compat/PDO.php",
   "themes/",
   "upgrade/",
   "vendor/XTemplate",
   "vendor/oauth2-php"
],