The Health Check wizard must be run when upgrading to evaluate whether your instance is suitable for upgrade. During the health check, various types of issues may be detected which can affect your ability to upgrade. This article will cover the “Use of removed Underscore APIs” error reported by the health check.
This error generates an output similar to the following in health check:
The generated error message will help determine the contents of the file causing the health check error. To address this issue, the code-level customization will need to be corrected or removed before proceeding with the upgrade.
The example error shown above was caused by a problem in the named file,
./custom/clients/base/views/analyticreporting/analyticreporting.js. This example custom code is using bindAll() without specifying method names. We can see this on line 23 of the problematic file:
Underscore.js library has been updated in Sugar 7.8 and above. It is no longer possible to call
bindAll() without specifying a list of methods to bind.
In order to proceed with the upgrade, either update or remove the offending line of code or disable the specified file. For this example,
_.bindAll(object, methodNames) must be used. More information can be found in the Underscore.js documentation.
Once the necessary change has been made, please navigate to Admin > Repair and perform a “Quick Repair and Rebuild”. Then, perform the health check again to confirm that the error is no longer reported.