Skip to content

Commit

Permalink
Merge branch '4.1' into 4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
robbieaverill committed Nov 7, 2018
2 parents a0c3627 + 37f9094 commit b631f75
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/Extension/FluentExtension.php
Expand Up @@ -449,7 +449,24 @@ public function updateDeleteTables(&$queriedTables)

// If table isn't localised, simple delete
if (!isset($localisedTables[$table])) {
$rootDelete->execute();
$baseTable = $this->getDeleteTableTarget($this->owner->baseTable());

// The base table isn't localised? Delete the record then.
if ($baseTable === $rootTable) {
$rootDelete->execute();
continue;
}

$rootDelete
->setDelete("\"{$rootTable}\"")
->addLeftJoin(
$baseTable,
"\"{$rootTable}\".\"ID\" = \"{$baseTable}\".\"ID\""
)
// Only when join matches no localisations is it safe to delete
->addWhere("\"{$baseTable}\".\"ID\" IS NULL")
->execute();

continue;
}

Expand Down

0 comments on commit b631f75

Please sign in to comment.