(Retrofit from trunk) #1299 Portal : "Oops, could not load data" when creating request in Full ITIL instance when running PHP7. Cause was that PHP7 isn't able to understand the factory method invocation synthax, had to make it more simple with intermediate steps.

SVN:2.3[4342]
This commit is contained in:
Guillaume Lajarige
2016-08-23 12:50:46 +00:00
parent b76c890408
commit fb551cc3d2

View File

@@ -280,18 +280,20 @@ class ObjectController extends AbstractController
// Retrieving target object (We check if the method is a simple function or if it's part of a class in which case only static function are supported)
if (!strpos($sMethodName, '::'))
{
$sTargetObject = $sMethodName($oOriginObject);
$oTargetObject = $sMethodName($oOriginObject);
}
else
{
$aMethodNameParts = explode('::', $sMethodName);
$sTargetObject = $aMethodNameParts[0]::$aMethodNameParts[1]($oOriginObject);
$sMethodClass = $aMethodNameParts[0];
$sMethodName = $aMethodNameParts[1];
$oTargetObject = $sMethodClass::$sMethodName($oOriginObject);
}
// Preparing redirection
// - Route
$aRouteParams = array(
'sObjectClass' => get_class($sTargetObject)
'sObjectClass' => get_class($oTargetObject)
);
$sRedirectRoute = $oApp['url_generator']->generate('p_object_create', $aRouteParams);
// - Request