N°2623 - Fix setup request error

This commit is contained in:
Eric
2019-12-09 14:56:42 +01:00
parent 9dc56b727e
commit 8482be7068

View File

@@ -7528,9 +7528,12 @@ abstract class MetaModel
$sKey = self::DBGetKey($sClass);
$sRootKey = self::DBGetKey($sRootClass);
$sRootField = self::DBGetClassField($sRootClass);
// Copy the finalclass of the root table
$sRequest = "UPDATE `$sTable`,`$sRootTable` SET `$sTable`.`$sField` = `$sRootTable`.`$sRootField` WHERE `$sTable`.`$sKey` = `$sRootTable`.`$sRootKey`";
$aRequests[] = $sRequest;
if ($sTable != $sRootTable)
{
// Copy the finalclass of the root table
$sRequest = "UPDATE `$sTable`,`$sRootTable` SET `$sTable`.`$sField` = `$sRootTable`.`$sRootField` WHERE `$sTable`.`$sKey` = `$sRootTable`.`$sRootKey`";
$aRequests[] = $sRequest;
}
}
return $aRequests;