Note: This issue is part of #2721129: Workflow Initiative and is only meant for planning and governance sign-offs. Work will happen in child issues of this plan.
Some historic background: #147723: Deletion API for core and http://drupal4hu.com/node/233
This phase will introduce two new methods in the content entity storage: softDelete()
and forceDelete()
. This is primarily important for replication and conflict management (see phase H) but also enables things like Trash module (see phase E).
The softDelete() method is the logical replacement of the traditional delete method. But instead of erasing the entity from the database, it will save a new revision with a timestamp base field called "deleted_at" set to the current request time. The entity query and storage API will add conditions on this base field where necessary. This method will also invoke a new hook called hook_entity_softdelete()
.
The forceDelete() method will erase an entity from the database and invoke hook_entity_forcedelete()
. The forceDelete()
method will also invoke the deprecated hook_entity_delete()
for backward compatibility reasons, as the traditional behaviour of this hook is to erase things from the database.
The softDelete()
and forceDelete()
methods also have more explicit names to what they actually do, while delete()
is more ambiguous.
Sign-offs needed
Product manager
A product manager needs to sign-off on this plan as the above phases are required as part of a planned initiative.
Framework manager
A framework manager needs to sign-off on this plan as the above phases introduces major API additions (archive and purge).
Sub-system maintainers
The sub-system maintainers for the Entity API needs to sign-off on this plan as it significantly impacts the Entity API.
Sign-offs given
- Product manager - pending
- Framework manager - pending
- Sub-system maintainers - pending
Comments
Comment #2
dixon_Comment #3
dixon_Comment #4
dixon_Comment #5
dixon_Comment #6
dixon_Comment #7
dixon_Comment #8
dixon_Comment #9
xjmThanks dixon_!
Tagging this one since it's also a near-term. (Edit: too many "also".)
Comment #10
dixon_Making it clearer that we are still working on the plan.
Comment #12
dixon_Comment #13
pwolanin CreditAttribution: pwolanin as a volunteer commentedBeing able to archive and restore was mentioned by webchick as an issue that came up in 2011 usability tests https://www.drupal.org/node/147723#comment-4498812
Given that it's very outdated, closing #147723: Deletion API for core as outdated and duplicate to this
Comment #15
dixon_This phase is no longer needed. Everything we need for Trash with be done in #2786135: WI: Phase E: Introduce Trash module
Comment #20
amateescu CreditAttribution: amateescu for Pfizer, Inc. commentedAfter a long discussion over the proposal for a "soft-deletion API" between @plach, @Fabianx, @catch, @dawehner and myself, we reached an agreement that largely resembles the initial goals of this issue, with a few changes:
- the existing
delete()
method shouldn't be deprecated, at least for now- we are proposing
softDelete()
andforceDelete()
instead ofarchive()
andpurge()
for the new methods- we are proposing a
deleted_at
timestamp base field with a default value of 0 instead of the booleandeleted
fieldTherefore I'm reopening this issue with revised issue summary, and #2786135: WI: Phase E: Introduce Trash module will be done as a followup to the plan (and implementation) agreed upon here.
Comment #21
hchonovThere is no mention about GDPR here yet, which I think should be considered because soft-deletes aren't allowed for data that falls under GDPR.
Comment #29
smustgrave CreditAttribution: smustgrave at Mobomo commentedThis issue is being reviewed by the kind folks in Slack, #need-reveiw-queue. We are working to keep the size of Needs Review queue [2700+ issues] to around 400 (1 month or less), following Review a patch or merge require as a guide.
This has been tagged for sign off/review from almost all levels of Drupal but haven't seen that.
After 3 years is the plan still the same?
Comment #30
smustgrave CreditAttribution: smustgrave at Mobomo commentedSending to NW for an IS update. Been told this has transitioned to a community initiative now so could use an update about what the plan is now and what tasks are needed.