Health Check Error: PHP4 Constructor Call

    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 the “Custom parent PHP4 constructor call” error reported by the health check.

    Symptoms

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

    Custom parent PHP4 constructor call

    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 corrected or removed before proceeding with the upgrade.

    The example error shown above was caused by a problem in the named file, ./custom/Custom_Class2.php. This example custom code uses a PHP4 constructor method where the class constructor method has the same name as the class. We can see this in the problematic file:

    <?php
    class Custom_Class2 extends Custom_Class1
    {
     public function Custom_Class2()
     {
     Custom_Class1::Custom_Class1();
     }
    }

    In Sugar 7.8.0.0, PHP4 constructor methods are no longer allowed and will trigger a Health Check failure.

    In order to proceed with the upgrade, class constructor method must be corrected. Below is the corrected version of the example code:

    <?php
    class Custom_Class2 extends Custom_Class1
    {
     public function __construct()
     {
     parent::__construct();
     }
    }

    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.

    in Troubleshooting Health Check Output

    Reach out to us for help