Skip to content

Commit

Permalink
Fix display of importing deleted elements
Browse files Browse the repository at this point in the history
  • Loading branch information
engram-design committed Mar 17, 2024
1 parent d33d985 commit 1fa88d5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/services/Import.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,12 @@ public function getImportConfiguration(array $data, bool $returnElementData = fa
$elementState = 'delete';
$elementActionState = 'delete';

// If there's an element marked as deleted, but doesn't exist on the destination install, then skip
// It's likely been created then deleted all on the source install.
if (!$currentElement) {
continue;
}

$elementToAction = $currentElement;
$newElement = null;
} else if ($itemState === 'restored') {
Expand Down Expand Up @@ -333,7 +339,7 @@ public function getImportPreview(string $id, array $data): array
if ($itemState === 'modified') {
$newElement = $elementType::getNormalizedElement($newItem, true);
} else if ($itemState === 'deleted') {
$newElement = $currentElement;
$newElement = null;
} else if ($itemState === 'restored') {
$newElement = $elementType::getNormalizedElement($newItem, true);
} else {
Expand Down

0 comments on commit 1fa88d5

Please sign in to comment.