diff --git a/datamodels/2.x/combodo-data-feature-removal/src/Controller/DataFeatureRemovalController.php b/datamodels/2.x/combodo-data-feature-removal/src/Controller/DataFeatureRemovalController.php index 28065f2cdd..248b7bc1d6 100644 --- a/datamodels/2.x/combodo-data-feature-removal/src/Controller/DataFeatureRemovalController.php +++ b/datamodels/2.x/combodo-data-feature-removal/src/Controller/DataFeatureRemovalController.php @@ -224,6 +224,7 @@ class DataFeatureRemovalController extends Controller $bIsDirEmpty = count(scandir($sBuildDir)) === 2; if ($bIsDirEmpty || $bForceCompilation) { + Session::Unset('bForceCompilation'); DataFeatureRemovalLog::Debug( __METHOD__, null, diff --git a/datamodels/2.x/combodo-data-feature-removal/src/Service/StaticDeletionPlan.php b/datamodels/2.x/combodo-data-feature-removal/src/Service/StaticDeletionPlan.php index df178b9b98..2283e0e465 100644 --- a/datamodels/2.x/combodo-data-feature-removal/src/Service/StaticDeletionPlan.php +++ b/datamodels/2.x/combodo-data-feature-removal/src/Service/StaticDeletionPlan.php @@ -26,9 +26,6 @@ class StaticDeletionPlan * * @return array<\Combodo\iTop\DataFeatureRemoval\Entity\DataCleanupSummaryEntity> * @throws \CoreException - * @throws \CoreUnexpectedValue - * @throws \MySQLException - * @throws \Combodo\iTop\DataFeatureRemoval\Helper\DataFeatureRemovalException */ public function GetCleanupSummary(?array $aClasses): array { @@ -160,21 +157,21 @@ SQL; */ public function UpdateHierarchicalExtKey(string $sRemoteClass, string $sExtKeyAttCode, string $sIdsToRemoveInTargetClass): DeletionPlanItem { - [$sDBTable, $sDBField] = $this->GetDBInfoForAttcode($sRemoteClass, $sExtKeyAttCode); + [$sDBTable, $sDBField, $sDBKey] = $this->GetDBInfoForAttcode($sRemoteClass, $sExtKeyAttCode); $sUpdateSQL = << $sUpdateSQL], $aIds); } @@ -193,10 +190,10 @@ SQL; if (\utils::IsNullOrEmptyString($sIdsToRemoveInTargetClass)) { return []; } - [$sDBTable, $sDBField] = $this->GetDBInfoForAttcode($sRemoteClass, $sExtKeyAttCode); - $sSQL = "SELECT id FROM $sDBTable WHERE $sDBField IN ($sIdsToRemoveInTargetClass)"; + [$sDBTable, $sDBField, $sDBKey] = $this->GetDBInfoForAttcode($sRemoteClass, $sExtKeyAttCode); + $sSQL = "SELECT $sDBKey FROM $sDBTable WHERE $sDBField IN ($sIdsToRemoveInTargetClass)"; - return CMDBSource::QueryToCol($sSQL, 'id'); + return CMDBSource::QueryToCol($sSQL, $sDBKey); } /** @@ -209,8 +206,9 @@ SQL; public function GetInitialClassDeletionPlan(string $sClass): DeletionPlanItem { $sTable = MetaModel::DBGetTable($sClass); - $sSQL = "SELECT id FROM $sTable"; - $aIds = CMDBSource::QueryToCol($sSQL, 'id'); + $sDBKey = MetaModel::DBGetKey($sClass); + $sSQL = "SELECT $sDBKey FROM $sTable"; + $aIds = CMDBSource::QueryToCol($sSQL, $sDBKey); $sDeleteSQL = "DELETE FROM $sTable"; return new DeletionPlanItem([$sDeleteSQL], $aIds); @@ -232,7 +230,8 @@ SQL; $sRealTable = MetaModel::DBGetTable($sRealClass); $oAttDef = MetaModel::GetAttributeDef($sRealClass, $sExtKeyAttCode); $sSQLAttCode = array_keys($oAttDef->GetSQLColumns())[0]; - return [$sRealTable, $sSQLAttCode]; + $sDBKey = MetaModel::DBGetKey($sRemoteClass); + return [$sRealTable, $sSQLAttCode, $sDBKey]; } } diff --git a/setup/unattended-install/xml_setup/upgrade.xml b/setup/unattended-install/xml_setup/upgrade.xml index bef34398af..0272bd2551 100644 --- a/setup/unattended-install/xml_setup/upgrade.xml +++ b/setup/unattended-install/xml_setup/upgrade.xml @@ -41,5 +41,5 @@ - on + off