ENHANCEMENT Allow extensions to intercept incorrect deletes on unpublish

This commit is contained in:
Damian Mooyman 2017-10-13 09:55:00 +13:00
parent a244884117
commit 7e97f04e47
No known key found for this signature in database
GPG Key ID: 78B823A10DE27D1A

View File

@ -1453,8 +1453,11 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity
->filter('ID', $this->ID)
->dataQuery()
->query();
foreach ($srcQuery->queriedTables() as $table) {
$delete = new SQLDelete("\"$table\"", array('"ID"' => $this->ID));
$queriedTables = $srcQuery->queriedTables();
$this->extend('updateDeleteTables', $queriedTables, $srcQuery);
foreach ($queriedTables as $table) {
$delete = SQLDelete::create("\"$table\"", array('"ID"' => $this->ID));
$this->extend('updateDeleteTable', $delete, $table, $queriedTables, $srcQuery);
$delete->execute();
}
// Remove this item out of any caches