You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The action succeeds but the element is only soft deleted in the database. This appears to be because the selected items are soft deleted on line 188 and then re-queried on line 194, which returns zero IDs because the query does not find the items that were just soft-deleted above:
if (!isset($deletedElementIds[$descendant->id]) && $descendant->getIsDeletable()) {
$elementsService->deleteElement($descendant);
$deletedElementIds[$descendant->id] = true;
}
}
}
$elementsService->deleteElement($element);
$deletedElementIds[$element->id] = true;
}
}
if ($this->hard) {
$ids = $query->ids();
if (!empty($ids)) {
Db::delete(Table::ELEMENTS, [
'id' => $ids,
]);
}
}
In looking into the issue I also noticed that this version of the hard delete does not take the extra step of deleting the related search index data, as the hard delete behavior in the service layer does:
Description
If I attempt to implement the Delete Action in a custom Element and set it to hard delete:
The action succeeds but the element is only soft deleted in the database. This appears to be because the selected items are soft deleted on line 188 and then re-queried on line 194, which returns zero IDs because the query does not find the items that were just soft-deleted above:
cms/src/elements/actions/Delete.php
Lines 175 to 200 in ba3b1e7
In looking into the issue I also noticed that this version of the hard delete does not take the extra step of deleting the related search index data, as the hard delete behavior in the service layer does:
cms/src/services/Elements.php
Lines 1525 to 1530 in ba3b1e7
The text was updated successfully, but these errors were encountered: