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

dixon_ created an issue. See original summary.

dixon_’s picture

Issue summary: View changes
dixon_’s picture

Issue summary: View changes
dixon_’s picture

dixon_’s picture

Issue summary: View changes
dixon_’s picture

Issue summary: View changes
dixon_’s picture

Issue tags: +Workflow Initiative
dixon_’s picture

Issue summary: View changes
xjm’s picture

Thanks dixon_!

Tagging this one since it's also a near-term. (Edit: too many "also".)

dixon_’s picture

Issue summary: View changes
Status: Active » Needs work

Making it clearer that we are still working on the plan.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.0-beta1 was released on August 3, 2016, which means new developments and disruptive changes should now be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

dixon_’s picture

Title: WI: Enable archive/purge storage and introduce Trash module » WI: Phase D: Enable archive/purge storage
Issue summary: View changes
pwolanin’s picture

Being 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

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

dixon_’s picture

Status: Needs work » Closed (won't fix)

This phase is no longer needed. Everything we need for Trash with be done in #2786135: WI: Phase E: Introduce Trash module

amateescu credited Fabianx.

amateescu credited catch.

amateescu credited plach.

amateescu’s picture

Version: 8.4.x-dev » 8.8.x-dev
Issue summary: View changes
Status: Closed (won't fix) » Needs review

After 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() and forceDelete() instead of archive() and purge() for the new methods
- we are proposing a deleted_at timestamp base field with a default value of 0 instead of the boolean deleted field

Therefore 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.

hchonov’s picture

Issue tags: +GDPR

There 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.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

smustgrave’s picture

This 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?

smustgrave’s picture

Status: Needs review » Needs work
Issue tags: +Needs issue summary update

Sending 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.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.