Health Check Error: Found print_r
Overview
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 how to resolve a Found "print_r" error reported by the health check.
Symptoms
This error generates an output similar to the following in health check:
Resolution
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 edited from Sugar before proceeding with the upgrade.
Breakdown of health check error:
- The file causing the error can be found in
./custom/Extension/modules/Accounts/Ext/print_rExample/print_rExample.php
. - The health check detects an issue on line 5 of the file.
In this example file, the code contains the print_r
function with a single parameter which is triggering the health check error.
The print_r
function with a single argument as shown in line 5 of the file is not allowed in Sugar 7.x and above. To resolve the health check error, change the code to add , true
after $moduleBean
, then re-save the file. The corrected file should then look like:
Once the necessary change has been made, please navigate to Admin > Repair and perform a "Quick Repair and Rebuild" to ensure that the changes are synced between the application and database. Then, perform the health check again to confirm that the error is no longer reported.