Health Check Error: Unsupported Method 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 "Unsupported method call" 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 corrected or removed before proceeding with the upgrade.
The example error shown above was caused by a problem in the named file, ./custom/include/ChartReports/SummaryQuery.php
. The example custom code uses a function, joinRaw()
, which has been removed in Sugar 7.9 and above. We can see this on line 436 of the problematic file:
$this->query->joinRaw($joinStatement);
- The following methods are deprecated. Use
SugarQuery
andSugarVisibility::addVisibilityQuery()
instead: SugarVisibility::addVisibilityFrom()
SugarVisibility::addVisibilityWhere()
SugarVisibility::addVisibilityFromQuery()
- The following methods are deprecated. Use
SugarQuery
andBeanVisibility::addVisibilityQuery()
instead:BeanVisibility::addVisibilityFrom()
BeanVisibility::addVisibilityWhere()
BeanVisibility::addVisibilityFromQuery()
SugarQuery_Builder_Delete
is deprecated. UseSugarBean::mark_deleted()
instead.- The following classes are deprecated. Use
SugarBean::save()
instead: SugarQuery_Builder_Insert
SugarQuery_Builder_Update
SugarQuery_Builder_Literal
is deprecated with no replacement since this class was never fully implemented.SugarQuery_Compiler
is deprecated. UseSugarQuery_Compiler_SQL
instead.SugarQuery::joinRaw()
is deprecated. UseSugarQuery::joinTable()
instead. You can specify aliases and join types using parameters that will allow you to continue to specify any custom join.SugarQuery::compileSql()
is deprecated. UseSugarQuery::execute()
instead.- The
$execute
parameter onDBManager::insertParams()
is deprecated. In the future,insertParams()
will always execute. - The
$execute
parameter onDBManager::updateParams()
is deprecated. In the future,updateParams()
will always execute. - The
$where
parameter onSugarBean::update()
is deprecated. This parameter is not necessary. DBManager::delete()
is deprecated. UseSugarBean::mark_deleted()
instead.DBManager::retrieve()
is deprecated. UseSugarBean::retrieve()
instead.DBManager::insertSQL()
is deprecated. UseDBManager::insert()
instead.DBManager::updateSQL()
is deprecated. UseDBManager::update()
instead.DBManager::deleteSQL()
is deprecated. UseSugarBean::mark_deleted()
instead.DBManager::retrieveSQL()
is deprecated. UseDBManager::retrieve()
instead.- The following
DBManager
methods are no longer necessary:-
DBManager::preparedQuery()
-
DBManager::pQuery()
-
DBManager::prepareQuery()
-
DBManager::prepareTypeData()
-
DBManager::prepareStatement()
-
In order to proceed with the upgrade, either update or remove the offending line of code or disable the specified file so that it no longer references the removed method. For this example, use joinTable()
instead of joinRaw()
.
$this->query->joinTable($joinStatement);
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.