From 837b433622c4049cfdf43494872df5fed11afdbb Mon Sep 17 00:00:00 2001 From: Molkobain Date: Wed, 22 Jul 2026 22:37:34 +0200 Subject: [PATCH] =?UTF-8?q?N=C2=B09831=20-=20Fix=20DataCleanupService=20so?= =?UTF-8?q?=20it=20handles=20external=20keys=20the=20same=20way=20as=20\Co?= =?UTF-8?q?mbodo\iTop\DataFeatureRemoval\Service\StaticDeletionPlan::Delet?= =?UTF-8?q?ionPlanForReferencingClasses=20and=20\DBObject::MakeDeletionPla?= =?UTF-8?q?n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Check if ext. key is nullable first - Then check if its a DEL_MANUAL option --- .../src/Service/DataCleanupService.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/datamodels/2.x/combodo-data-feature-removal/src/Service/DataCleanupService.php b/datamodels/2.x/combodo-data-feature-removal/src/Service/DataCleanupService.php index e2d3956b7a..180ef7af22 100644 --- a/datamodels/2.x/combodo-data-feature-removal/src/Service/DataCleanupService.php +++ b/datamodels/2.x/combodo-data-feature-removal/src/Service/DataCleanupService.php @@ -134,10 +134,6 @@ class DataCleanupService /** @var DBObject $oDependentObj */ while ($oDependentObj = $oSet->Fetch()) { $iDeletePropagationOption = $oExtKeyAttDef->GetDeletionPropagationOption(); - if ($iDeletePropagationOption == DEL_MANUAL) { - $this->oObjectService->SetIssue(get_class($oDependentObj)); - continue; - } if ($oExtKeyAttDef->IsNullAllowed()) { // Optional external key, list to reset @@ -152,6 +148,12 @@ class DataCleanupService return false; } } else { + // Mandatory external key + if ($iDeletePropagationOption == DEL_MANUAL) { + // Cannot be deleted automatically, must be handled manually + $this->oObjectService->SetIssue(get_class($oDependentObj)); + continue; + } // Propagate deletion only if not visited if ($this->IsVisited($oDependentObj)) { continue;