Skip to content

Commit

Permalink
Handle entity deletes accurately and throw helpful error message (#213)
Browse files Browse the repository at this point in the history
  • Loading branch information
pookmish authored Dec 8, 2020
1 parent 94eb77c commit 1fc00ab
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion includes/CAPx/Drupal/Processors/EntityProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ protected function executeMultiple($force = FALSE) {

$mapper = $this->getMapper();
$data = $this->getData();
if (empty($mapper->getConfigSetting("subquery"))) {
throw new \Exception('Subquery must entered to import multiple items');
}
$numEntities = $mapper->getMultipleEntityCountBySubquery($data);

// Let the Orphan cron runs take care of the clean up. We just need to stop.
Expand Down Expand Up @@ -112,7 +115,7 @@ protected function executeMultiple($force = FALSE) {
// NO GUUID available. Delete all of the existing entities and replace with
// new ones.
if (empty($guuidPath)) {
$this->multipleDeleteEntities($entities);
$this->multipleDeleteEntities($entityType, array_keys($entities));
$this->multipleCreateNewEntity($numEntities, $entityType, $bundleType, $data, $mapper);
return;
}
Expand Down

0 comments on commit 1fc00ab

Please sign in to comment.