mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge pull request #7477 from open-sausages/pulls/4.0/intercept-incorrect-deletes
ENHANCEMENT Allow extensions to intercept incorrect deletes on unpublish
This commit is contained in:
commit
11817592fd
@ -1453,8 +1453,11 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity
|
|||||||
->filter('ID', $this->ID)
|
->filter('ID', $this->ID)
|
||||||
->dataQuery()
|
->dataQuery()
|
||||||
->query();
|
->query();
|
||||||
foreach ($srcQuery->queriedTables() as $table) {
|
$queriedTables = $srcQuery->queriedTables();
|
||||||
$delete = new SQLDelete("\"$table\"", array('"ID"' => $this->ID));
|
$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();
|
$delete->execute();
|
||||||
}
|
}
|
||||||
// Remove this item out of any caches
|
// Remove this item out of any caches
|
||||||
|
Loading…
Reference in New Issue
Block a user