Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is to implement changes as requested in #3392, making 3.1's Soft Delete optional.
It's implemented by selecting the new soft delete or the previous hard delete code exactly.
The choice is made simply, via a flag field added to the current ElementEvent.
The plugin in need, Live Vue, simply sets this flag when deleting its hidden Live Preview records. The process with potential flag state is protected by a try/catch/finally code path, when deletion occurs via Elements service deleteById().
Since the operation occurs in Elements::deleteElement(), it will be available for any type of element deletion. At the same time, it's defaulted so that unless an EVENT_BEFORE_DELETE_ELEMENT is taken by the using program, soft delete will always be used as expected in 3.1.